Class SortedProperties

All Implemented Interfaces:
Serializable, Cloneable, Map<Object,Object>

public final class SortedProperties extends Properties
Author:
pugh
See Also:
  • Constructor Details

    • SortedProperties

      public SortedProperties()
  • Method Details

    • keys

      public Enumeration<Object> keys()
      Overriden to be able to write properties sorted by keys to the disk
      Overrides:
      keys in class Properties
      See Also:
    • sortKeys

      public static Enumeration<?> sortKeys(Set<String> keySet)
      To be compatible with version control systems, we need to sort properties before storing them to disk. Otherwise each change may lead to problems by diff against previous version - because Property entries are randomly distributed (it's a map).
      Parameters:
      keySet - non null set instance to sort
      Returns:
      non null list which contains all given keys, sorted lexicographically. The list may be empty if given set was empty