¿Cómo ordenar propiedades en java?
Tengo una variable de propiedades y, a veces, necesito agregar otras propiedades.
<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>
Quiero ordenarmyBasicProps
después de este. No quiero obtener todas las claves y valores, ordenarlos conCollections.sort()
y luego ponerlo todo en un nuevo objeto. ¿Hay alguna manera mejor?