Class Properties

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable, java.util.Map<java.lang.String,​java.lang.String>

    public class Properties
    extends java.util.LinkedHashMap<java.lang.String,​java.lang.String>
    See Also:
    Serialized Form
    • Nested Class Summary

      • Nested classes/interfaces inherited from class java.util.AbstractMap

        java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>
    • Constructor Summary

      Constructors 
      Constructor Description
      Properties()  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean getBoolean​(java.lang.String key)
      Returns a property parsed to String
      java.util.Properties java()
      Map all entries on this instance to a new java.util.Properties object
      void load​(java.io.File file)
      The the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't exists
      void load​(java.io.InputStream inputStream)
      The the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't exists
      void load​(java.io.Reader reader)
      The the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't exists
      void load​(java.nio.file.Path path)
      The the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't exists
      static Properties parseLine​(java.lang.String line)
      Parsed all properties, from a commandLine and split up into key/value pairs
      static Properties parseLine​(java.lang.String[] args)
      Parsed all properties, from a commandLine and split up into key/value pairs
      void save​(java.io.File file)
      Writes all properties into the file like the .properties default in UTF-8
      void save​(java.io.OutputStream outputStream)
      Writes all properties into the file like the .properties default in UTF-8
      void save​(java.io.Writer writer)
      Writes all properties into the file like the .properties default in UTF-8
      void save​(java.lang.String commit, java.io.File file)
      Writes all properties into the file like the .properties default in UTF-8
      void save​(java.lang.String commit, java.io.OutputStream outputStream)
      Writes all properties into the file like the .properties default in UTF-8
      void save​(java.lang.String commit, java.io.Writer writer)
      Writes all properties into the file like the .properties default in UTF-8
      void save​(java.lang.String commit, java.nio.file.Path path)
      Writes all properties into the file like the .properties default in UTF-8
      void save​(java.nio.file.Path path)
      Writes all properties into the file like the .properties default in UTF-8
      • Methods inherited from class java.util.LinkedHashMap

        clear, containsValue, entrySet, forEach, get, getOrDefault, keySet, removeEldestEntry, replaceAll, values
      • Methods inherited from class java.util.HashMap

        clone, compute, computeIfAbsent, computeIfPresent, containsKey, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
      • Methods inherited from class java.util.AbstractMap

        equals, hashCode, toString
      • Methods inherited from class java.lang.Object

        finalize, getClass, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.Map

        compute, computeIfAbsent, computeIfPresent, containsKey, equals, hashCode, isEmpty, merge, put, putAll, putIfAbsent, remove, remove, replace, replace, size
    • Constructor Detail

      • Properties

        public Properties()
    • Method Detail

      • parseLine

        public static Properties parseLine​(java.lang.String line)
        Parsed all properties, from a commandLine and split up into key/value pairs

        "count_of_fingers --are fingers=16" will be to

        count_of_fingers = true are = true fingers = 16

        Parameters:
        line - the following command line which should parsed
        Returns:
        the current Properties object instance
      • parseLine

        public static Properties parseLine​(java.lang.String[] args)
        Parsed all properties, from a commandLine and split up into key/value pairs

        "count_of_fingers --are fingers=16" will be to

        count_of_fingers = true are = true fingers = 16

        Parameters:
        args - the split command line arguments
        Returns:
        the current Properties object instance
      • getBoolean

        public boolean getBoolean​(java.lang.String key)
        Returns a property parsed to String
        Parameters:
        key - the property, which should get
        Returns:
        the property parsed as boolean
      • load

        public void load​(java.io.File file)
                  throws java.io.IOException
        The the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't exists
        Parameters:
        file - the path, from that the properties should load
        Throws:
        java.io.IOException - if exists an error to read the file
        See Also:
        Properties
      • load

        public void load​(java.nio.file.Path path)
                  throws java.io.IOException
        The the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't exists
        Parameters:
        path - the path, from that the properties should load
        Throws:
        java.io.IOException - if exists an error to read the file
        See Also:
        Properties
      • load

        public void load​(java.io.InputStream inputStream)
                  throws java.io.IOException
        The the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't exists
        Parameters:
        inputStream - the inputStream, from that the properties should load
        Throws:
        java.io.IOException - if exists an error to read the file
        See Also:
        Properties
      • load

        public void load​(java.io.Reader reader)
                  throws java.io.IOException
        The the data from a .properties file in the properties from by Sun/Oracle It do nothing, if the file is null or doesn't exists
        Parameters:
        reader - the Reader, from that the properties should load
        Throws:
        java.io.IOException - if exists an error to read the file
        See Also:
        Properties
      • save

        public void save​(java.io.File file)
                  throws java.io.IOException
        Writes all properties into the file like the .properties default in UTF-8
        Parameters:
        file - the target file, which should be written
        Throws:
        java.io.IOException - if an problem to write into the file exists
        See Also:
        Properties
      • save

        public void save​(java.lang.String commit,
                         java.io.File file)
                  throws java.io.IOException
        Writes all properties into the file like the .properties default in UTF-8
        Parameters:
        commit - an optional comment on the file header
        file - the target file, which should be written
        Throws:
        java.io.IOException - if an problem to write into the file exists
        See Also:
        Properties
      • save

        public void save​(java.nio.file.Path path)
                  throws java.io.IOException
        Writes all properties into the file like the .properties default in UTF-8
        Parameters:
        path - the target file, which should be written
        Throws:
        java.io.IOException - if an problem to write into the file exists
        See Also:
        Properties
      • save

        public void save​(java.lang.String commit,
                         java.nio.file.Path path)
                  throws java.io.IOException
        Writes all properties into the file like the .properties default in UTF-8
        Parameters:
        commit - an optional comment on the file header
        path - the target file, which should be written
        Throws:
        java.io.IOException - if an problem to write into the file exists
        See Also:
        Properties
      • save

        public void save​(java.io.OutputStream outputStream)
                  throws java.io.IOException
        Writes all properties into the file like the .properties default in UTF-8
        Parameters:
        outputStream - the target outputStream, which should be written
        Throws:
        java.io.IOException - if an problem to write into the file exists
        See Also:
        Properties
      • save

        public void save​(java.lang.String commit,
                         java.io.OutputStream outputStream)
                  throws java.io.IOException
        Writes all properties into the file like the .properties default in UTF-8
        Parameters:
        commit - an optional comment on the file header
        outputStream - the target outputStream, which should be written
        Throws:
        java.io.IOException - if an problem to write into the file exists
        See Also:
        Properties
      • save

        public void save​(java.io.Writer writer)
        Writes all properties into the file like the .properties default in UTF-8
        Parameters:
        writer - the target Writer, which should use
        See Also:
        Properties
      • save

        public void save​(java.lang.String commit,
                         java.io.Writer writer)
        Writes all properties into the file like the .properties default in UTF-8
        Parameters:
        commit - an optional comment on the file header
        writer - the target Writer, which should use
        See Also:
        Properties
      • java

        public java.util.Properties java()
        Map all entries on this instance to a new java.util.Properties object