Wie sortiere ich Immobilien in Java?
Ich habe eine Eigenschaftsvariable und manchmal muss ich ihr andere Eigenschaften hinzufügen.
<code>Properties myBasicProps = this.getClass.getResourceAsStream(MY_PROPS_PATH); ... Properties otherProps = new Properties(); otherProps.load(new StringReader(tempPropsString)); //tempPropsString contains my temporary properties myBasicProps.putAll(otherProps); </code>
Ich möchte sortierenmyBasicProps
danach. Ich möchte nicht alle Schlüssel und Werte erhalten, sondern sie sortierenCollections.sort()
und dann setzen Sie alles auf ein neues Objekt. Gibt es einen besseren Weg?