Class PropertyCfg<T>

  • All Implemented Interfaces:
    Property, java.lang.Comparable<Property>

    public class PropertyCfg<T>
    extends java.lang.Object
    implements Property
    The class is the Property interface default implementation that can be used with Innovator applications. The application uses this class to specify the properties which it will react to upon runtime; this is done using a PropertyProvider. You can specify a wide array of property configurations that are, e.g. given to the PropertyProvider upon creation.
    Author:
    borschet
    See Also:
    PropertyProvider, Property, PropertyProviderDefault
    • Constructor Summary

      Constructors 
      Constructor Description
      PropertyCfg​(java.lang.String key, java.lang.String help)
      Creates a property configuration without a default value.
      PropertyCfg​(java.lang.String key, T defVal, java.lang.String help)
      Creates a property configuration of type T with a name, corresponding help string and configured default value.
    • Constructor Detail

      • PropertyCfg

        public PropertyCfg​(java.lang.String key,
                           T defVal,
                           java.lang.String help)
        Creates a property configuration of type T with a name, corresponding help string and configured default value.
        Parameters:
        key - the property name
        defVal - the default value
        help - additional help information shown about using the application
      • PropertyCfg

        public PropertyCfg​(java.lang.String key,
                           java.lang.String help)
        Creates a property configuration without a default value.
        Parameters:
        key - the property name
        help - additional help information shown about using the application
    • Method Detail

      • getKey

        public java.lang.String getKey()
        Getter for key.
        Specified by:
        getKey in interface Property
        Returns:
        The name of the key
      • getDefaultAsString

        public java.lang.String getDefaultAsString()
        Getter for default value as string.
        Specified by:
        getDefaultAsString in interface Property
        Returns:
        The default value as string.
      • getDescription

        public java.lang.String getDescription()
        Getter for additional help.
        Specified by:
        getDescription in interface Property
        Returns:
        A (hopefully) helpful description that was configured, which a user can view.
      • getDefaultValue

        public java.lang.Object getDefaultValue()
        Getter for default value.
        Specified by:
        getDefaultValue in interface Property
        Returns:
        The default value that was previously configured as a (castable) object.
      • compareTo

        public int compareTo​(Property o)
        Specified by:
        compareTo in interface java.lang.Comparable<T>