Class PropertyFileReader

    • Constructor Detail

      • PropertyFileReader

        public PropertyFileReader()
        Constructor.
    • Method Detail

      • addProperty

        public boolean addProperty​(String key,
                                   String value)
        Description copied from interface: PropertyReader
        Add a single Property to the Property list. If the property already exist in the List, the new entry will not added and the method return false.
        Specified by:
        addProperty in interface PropertyReader
        Parameters:
        key - as String
        value - as String
        Returns:
        true on success
      • addPropertyList

        public boolean addPropertyList​(Map<String,​String> resource)
        Description copied from interface: PropertyReader
        Extend property list by Map<String, String>.
        Specified by:
        addPropertyList in interface PropertyReader
        Parameters:
        resource - as Map
        Returns:
        true on success
      • appendPropertiesFromClasspath

        public boolean appendPropertiesFromClasspath​(String resource)
        Description copied from interface: PropertyReader
        Load a property List from an given file inside the classpath. eg: org/europa/together/properties/file.properties
        Specified by:
        appendPropertiesFromClasspath in interface PropertyReader
        Parameters:
        resource - as String
        Returns:
        true on success
      • appendPropertiesFromFile

        public boolean appendPropertiesFromFile​(String resource)
        Description copied from interface: PropertyReader
        Load a property List from an external file. eg: /home/usr/application/file.properties
        Specified by:
        appendPropertiesFromFile in interface PropertyReader
        Parameters:
        resource - as String
        Returns:
        true on success
      • clear

        public boolean clear()
        Description copied from interface: PropertyReader
        Clear the entire property list.
        Specified by:
        clear in interface PropertyReader
        Returns:
        true on success
      • removeProperty

        public boolean removeProperty​(String key)
        Description copied from interface: PropertyReader
        Remove a property by the given key from the list. If the property not exists the method return false.
        Specified by:
        removeProperty in interface PropertyReader
        Parameters:
        key - as String
        Returns:
        true on success
      • updateProperty

        public boolean updateProperty​(String key,
                                      String value)
        Description copied from interface: PropertyReader
        Update an existing property entry. In the case the entry don't exist, he will be created.
        Specified by:
        updateProperty in interface PropertyReader
        Parameters:
        key - as String
        value - as String
        Returns:
        true on success
      • count

        public int count()
        Description copied from interface: PropertyReader
        Counts the amount of all properties and return the value.
        Specified by:
        count in interface PropertyReader
        Returns:
        count of properties as int
      • getPropertyAsBoolean

        public Boolean getPropertyAsBoolean​(String key)
        Description copied from interface: PropertyReader
        Get the value of a property as boolean. Allowed values are:
        • 0 | 1
        • false | true
        • FALSE | TRUE
        All other values will evaluate to null.
        Specified by:
        getPropertyAsBoolean in interface PropertyReader
        Parameters:
        key - property given as String
        Returns:
        Boolean PropertyKeyAsBoolean
      • getPropertyAsInt

        public Integer getPropertyAsInt​(String key)
        Description copied from interface: PropertyReader
        Get the value of a property as Integer.
        Specified by:
        getPropertyAsInt in interface PropertyReader
        Parameters:
        key - property given as String
        Returns:
        int PropertyKeyAsInteger
      • getPropertyAsString

        public String getPropertyAsString​(String key)
        Description copied from interface: PropertyReader
        Get the property value as String.
        Specified by:
        getPropertyAsString in interface PropertyReader
        Parameters:
        key - property given as String
        Returns:
        String PropertyAsString