Class DefaultProfile

  • All Implemented Interfaces:
    IProfile, java.io.Serializable
    Direct Known Subclasses:
    SourceProfile

    @JsonData
    public class DefaultProfile
    extends java.lang.Object
    implements IProfile
    The class contains the default i-net PDFC profile.
    Since:
    4.0
    See Also:
    Serialized Form
    • Constructor Detail

      • DefaultProfile

        public DefaultProfile()
        Default constructor with empty properties
        Since:
        4.0
      • DefaultProfile

        public DefaultProfile​(IProfile sourceProfile)
        Creates a new profile as copy of another profile
        Parameters:
        sourceProfile - the config to copy from, must not be null
        Since:
        4.0
    • Method Detail

      • addProfileChangeListener

        public void addProfileChangeListener​(DefaultProfile.ProfileChangeListener l)
        Adds a listener to be notified if a profile value changed
        Parameters:
        l - the listener to be added
        Since:
        3.0
      • removeProfileChangeListener

        public void removeProfileChangeListener​(DefaultProfile.ProfileChangeListener l)
        Removes a listener to be no more notified
        Parameters:
        l - the listener to be removed
        Since:
        3.0
      • getBool

        public boolean getBool​(java.lang.String propertyName)
        Returns the value of the specified PDFCProperty as a boolean. If it was not specified in the configuration file, the default value will be returned.
        Specified by:
        getBool in interface IProfile
        Parameters:
        propertyName - the name of the property to get the value for
        Returns:
        the value as a boolean
        Since:
        1.08
      • getInt

        public int getInt​(java.lang.String propertyName)
        Returns the value of the specified PDFCProperty as an int. If it was not specified in the configuration file, the default value will be returned.
        Specified by:
        getInt in interface IProfile
        Parameters:
        propertyName - the name of the property to get the value for
        Returns:
        the value as an integer
        Since:
        1.08
      • getDouble

        public double getDouble​(java.lang.String propertyName)
        Returns the value of the specified PDFCProperty as a double. If it was not specified in the configuration file, the default value will be returned.
        Specified by:
        getDouble in interface IProfile
        Parameters:
        propertyName - the name of the property to get the value for
        Returns:
        the value as a double
        Since:
        1.08
      • getObject

        public java.lang.Object getObject​(java.lang.String propertyName)
        Returns the value of the specified PDFCProperty as an Object. If it was not specified in the configuration file, the default value will be returned.
        Specified by:
        getObject in interface IProfile
        Parameters:
        propertyName - the name of the property to get the value for
        Returns:
        the value as a Object
        My be null if there is no value for the key and the key does not provide a default value.
        Since:
        1.08
      • getString

        public java.lang.String getString​(java.lang.String propertyName)
        Returns the value of the specified PDFCProperty as a String. If it was not specified in the configuration file, the default value will be returned.
        Specified by:
        getString in interface IProfile
        Parameters:
        propertyName - the name of the property to get the value for
        Returns:
        the value as a String
        never null, but may be empty
        Since:
        1.08
      • putValue

        public void putValue​(PDFCProperty<?> property,
                             java.lang.String value)
        Stores a property in the current configuration. This value will NOT be saved in the file system but rather is used for the currently running VM instance.
        Specified by:
        putValue in interface IProfile
        Parameters:
        property - the property to be stored
        value - the value of the property
      • putValue

        public void putValue​(java.lang.String propertyName,
                             java.lang.String value)
        Stores a property in the current configuration. This value will NOT be saved in the file system but rather is used for the currently running VM instance.
        Specified by:
        putValue in interface IProfile
        Parameters:
        propertyName - the name of the property to get the value for
        value - the value of the property, must not be null
      • putValues

        public void putValues​(java.util.Properties values)
        Stores all properties in the current configuration. This value will NOT be saved in the file system but rather is used for the currently running VM instance. Change events will only be fired for values that have changed.
        Specified by:
        putValues in interface IProfile
        Parameters:
        values - the instance of values
      • getProperties

        public java.util.Properties getProperties()
        Returns set of properties defined in this configuration
        Returns:
        the profile properties
        Since:
        1.0
      • getObject

        public java.lang.Object getObject​(PDFCProperty<?> property)
        Returns the value of the specified PDFCProperty as an Object. If it was not specified in the configuration file, the default value will be returned.
        Specified by:
        getObject in interface IProfile
        Parameters:
        property - the property to get the value for
        Returns:
        the value as an Object
        My be null if there is no value for the key and the key does not provide a default value.
        Since:
        1.0
      • getString

        public java.lang.String getString​(PDFCProperty<?> property)
        Returns the value of the specified PDFCProperty as a String. If it was not specified in the configuration file, the default value will be returned.
        Specified by:
        getString in interface IProfile
        Parameters:
        property - the property to get the value for
        Returns:
        the value as a String
        never null, but may be empty
        Since:
        1.0
      • getInt

        public int getInt​(PDFCProperty<?> property)
        Returns the value of the specified PDFCProperty as an int. If it was not specified in the configuration file, the default value will be returned.
        Specified by:
        getInt in interface IProfile
        Parameters:
        property - the property to get the value for
        Returns:
        the value as integer
        Since:
        1.0
      • getDouble

        public double getDouble​(PDFCProperty<?> property)
        Returns the value of the specified PDFCProperty as a double. If it was not specified in the configuration file, the default value will be returned.
        Specified by:
        getDouble in interface IProfile
        Parameters:
        property - the property to get the value for
        Returns:
        the value as a double
        Since:
        1.0
      • getBool

        public boolean getBool​(PDFCProperty<?> property)
        Returns the value of the specified PDFCProperty as a boolean. If it was not specified in the configuration file, the default value will be returned.
        Specified by:
        getBool in interface IProfile
        Parameters:
        property - the property to get the value for
        Returns:
        the value as a boolean.
        Since:
        1.0