Class PropertyStore

  • Direct Known Subclasses:
    AbstractStoreManager, BasePropertyStore, Configuration

    public abstract class PropertyStore
    extends Object
    Representation of a store of properties. The properties can be for persistence, or for the datastore, or whatever. This class provides convenience type accessors to the properties.
    • Constructor Detail

      • PropertyStore

        public PropertyStore()
    • Method Detail

      • setPropertyInternal

        protected void setPropertyInternal​(String name,
                                           Object value)
        Method to set a property in the store
        Parameters:
        name - Name of the property
        value - Its value
      • getProperty

        public Object getProperty​(String name)
        Method to get the value of a property from the store.
        Parameters:
        name - Name of the property
        Returns:
        Its value (or null)
      • hasProperty

        public boolean hasProperty​(String name)
        Accessor for whether a particular property is defined (but may be null).
        Parameters:
        name - Property name
        Returns:
        Whether the property is defined
      • hasPropertyNotNull

        public boolean hasPropertyNotNull​(String name)
        Accessor for whether a particular property is defined and has a non-null value.
        Parameters:
        name - Property name
        Returns:
        Whether the property is defined
      • getIntProperty

        public int getIntProperty​(String name)
        Accessor for the specified property as an int. If the specified property isn't found returns 0.
        Parameters:
        name - Name of the property
        Returns:
        Int value for the property
        Throws:
        PropertyTypeInvalidException - thrown when the property is not available as this type
      • getBooleanProperty

        public boolean getBooleanProperty​(String name)
        Accessor for the specified property as a boolean. If the specified property isn't found returns false.
        Parameters:
        name - Name of the property
        Returns:
        Boolean value for the property
        Throws:
        PropertyTypeInvalidException - thrown when the property is not available as this type
      • getBooleanProperty

        public boolean getBooleanProperty​(String name,
                                          boolean resultIfNotSet)
        Accessor for the specified property as a boolean.
        Parameters:
        name - Name of the property
        resultIfNotSet - The value to return if no value for the specified property is found.
        Returns:
        Boolean value for the property
        Throws:
        PropertyTypeInvalidException - thrown when the property is not available as this type
      • getBooleanObjectProperty

        public Boolean getBooleanObjectProperty​(String name)
        Accessor for the specified property as a Boolean. If the specified property isn't found returns false.
        Parameters:
        name - Name of the property
        Returns:
        Boolean value for the property (or null if not present)
        Throws:
        PropertyTypeInvalidException - thrown when the property is not available as this type
      • getStringProperty

        public String getStringProperty​(String name)
        Accessor for the specified property as a String. If the specified property isn't found returns null.
        Parameters:
        name - Name of the property
        Returns:
        String value for the property
        Throws:
        PropertyTypeInvalidException - thrown when the property is not available as this type
      • getFrequentProperties

        public FrequentlyAccessedProperties getFrequentProperties()
        Returns:
        properties, which are stored in field for faster access