Class Properties

java.lang.Object
net.seesharpsoft.commons.collection.Properties
All Implemented Interfaces:
java.io.Serializable, java.util.Map

public class Properties
extends java.lang.Object
implements java.util.Map, java.io.Serializable
Hierarchical properties that are by default case-insensitive.
See Also:
Serialized Form
  • Nested Class Summary

    Nested classes/interfaces inherited from interface java.util.Map

    java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
  • Field Summary

    Fields 
    Modifier and Type Field Description
    static java.lang.String COMMENT_LINE_BEGINNING  
    static java.lang.String DEFAULT_KEY_VALUE_SEPARATOR  
  • Constructor Summary

    Constructors 
    Constructor Description
    Properties()  
    Properties​(boolean caseSensitive)  
    Properties​(Properties parentProperties)  
    Properties​(Properties parentProperties, boolean caseSensitive)  
  • Method Summary

    Modifier and Type Method Description
    void clear()  
    boolean containsKey​(java.lang.Object key)  
    boolean containsValue​(java.lang.Object value)  
    java.util.Set<java.util.Map.Entry> entrySet()  
    java.lang.Object get​(java.lang.Object key)  
    <T> T get​(java.lang.String key)  
    protected java.lang.String getKey​(java.lang.Object key)  
    <T> T getOrDefault​(java.lang.String key, T fallback)  
    boolean isEmpty()  
    java.util.Set keySet()  
    java.util.Properties legacy()  
    java.lang.Object put​(java.lang.Object key, java.lang.Object value)  
    <T> T put​(java.lang.String key, java.lang.Object value)  
    void putAll​(java.util.Map map)  
    static Properties read​(java.io.File file)  
    static Properties read​(java.io.File file, java.lang.String keyValueSeparator)  
    static Properties read​(java.io.File file, java.lang.String keyValueSeparator, java.nio.charset.Charset encoding)  
    static Properties read​(java.io.File file, java.nio.charset.Charset encoding)  
    java.lang.Object remove​(java.lang.Object key)  
    <T> T remove​(java.lang.String key)  
    int size()  
    void store​(java.io.File file)  
    void store​(java.io.File file, boolean deep)  
    void store​(java.io.File file, java.lang.String keyValueSeparator)  
    void store​(java.io.File file, java.lang.String keyValueSeparator, java.nio.charset.Charset encoding, boolean deep)  
    java.util.Collection values()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface java.util.Map

    compute, computeIfAbsent, computeIfPresent, equals, forEach, getOrDefault, hashCode, merge, putIfAbsent, remove, replace, replace, replaceAll
  • Field Details

  • Constructor Details

  • Method Details

    • read

      public static Properties read​(java.io.File file, java.lang.String keyValueSeparator, java.nio.charset.Charset encoding) throws java.io.IOException
      Throws:
      java.io.IOException
    • read

      public static Properties read​(java.io.File file) throws java.io.IOException
      Throws:
      java.io.IOException
    • read

      public static Properties read​(java.io.File file, java.lang.String keyValueSeparator) throws java.io.IOException
      Throws:
      java.io.IOException
    • read

      public static Properties read​(java.io.File file, java.nio.charset.Charset encoding) throws java.io.IOException
      Throws:
      java.io.IOException
    • getKey

      protected java.lang.String getKey​(java.lang.Object key)
    • put

      public <T> T put​(java.lang.String key, java.lang.Object value)
    • get

      public <T> T get​(java.lang.String key)
    • getOrDefault

      public <T> T getOrDefault​(java.lang.String key, T fallback)
    • remove

      public <T> T remove​(java.lang.String key)
    • putAll

      public void putAll​(java.util.Map map)
      Specified by:
      putAll in interface java.util.Map
    • size

      public int size()
      Specified by:
      size in interface java.util.Map
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface java.util.Map
    • containsKey

      public boolean containsKey​(java.lang.Object key)
      Specified by:
      containsKey in interface java.util.Map
    • containsValue

      public boolean containsValue​(java.lang.Object value)
      Specified by:
      containsValue in interface java.util.Map
    • get

      public java.lang.Object get​(java.lang.Object key)
      Specified by:
      get in interface java.util.Map
    • put

      public java.lang.Object put​(java.lang.Object key, java.lang.Object value)
      Specified by:
      put in interface java.util.Map
    • remove

      public java.lang.Object remove​(java.lang.Object key)
      Specified by:
      remove in interface java.util.Map
    • clear

      public void clear()
      Specified by:
      clear in interface java.util.Map
    • keySet

      public java.util.Set keySet()
      Specified by:
      keySet in interface java.util.Map
    • values

      public java.util.Collection values()
      Specified by:
      values in interface java.util.Map
    • entrySet

      public java.util.Set<java.util.Map.Entry> entrySet()
      Specified by:
      entrySet in interface java.util.Map
    • store

      public void store​(java.io.File file, java.lang.String keyValueSeparator, java.nio.charset.Charset encoding, boolean deep) throws java.io.IOException
      Throws:
      java.io.IOException
    • store

      public void store​(java.io.File file, java.lang.String keyValueSeparator) throws java.io.IOException
      Throws:
      java.io.IOException
    • store

      public void store​(java.io.File file, boolean deep) throws java.io.IOException
      Throws:
      java.io.IOException
    • store

      public void store​(java.io.File file) throws java.io.IOException
      Throws:
      java.io.IOException
    • legacy

      public java.util.Properties legacy()