Class ConfigProperty


  • public final class ConfigProperty
    extends Object
    Component configuration property.
    • Method Detail

      • defineProperty

        public static ConfigProperty defineProperty​(String name,
                                                    ConfigProperty.Type type,
                                                    String defaultValue,
                                                    String description)
        Creates a new configuration property with its default value.
        Parameters:
        name - property name
        type - value type
        defaultValue - default value as a string
        description - property description
        Returns:
        newly defined property
      • setProperty

        public static ConfigProperty setProperty​(ConfigProperty property,
                                                 String newValue)
        Creates a new configuration property as a copy of an existing one, but with a new value.
        Parameters:
        property - property to be changed
        newValue - new value as a string
        Returns:
        newly updated property
      • resetProperty

        public static ConfigProperty resetProperty​(ConfigProperty property)
        Creates a new configuration property as a copy of an existing one, but without a specific value, thus making it take its default value.
        Parameters:
        property - property to be reset
        Returns:
        newly reset property
      • name

        public String name()
        Returns the property name.
        Returns:
        property name
      • description

        public String description()
        Returns the property description.
        Returns:
        string value
      • defaultValue

        public String defaultValue()
        Returns the property default value as a string.
        Returns:
        string default value
      • value

        public String value()
        Returns the property value as a string.
        Returns:
        string value
      • isSet

        public boolean isSet()
        Indicates whether the property is set or whether it assumes its default value.
        Returns:
        true if the property is set
      • asString

        public String asString()
        Returns the property value as a string.
        Returns:
        string value
      • asByte

        public byte asByte()
        Returns the property value as a byte.
        Returns:
        byte value
      • asInteger

        public int asInteger()
        Returns the property value as an integer.
        Returns:
        integer value
      • asLong

        public long asLong()
        Returns the property value as a long.
        Returns:
        long value
      • asFloat

        public float asFloat()
        Returns the property value as a float.
        Returns:
        float value
      • asDouble

        public double asDouble()
        Returns the property value as a double.
        Returns:
        double value
      • asBoolean

        public boolean asBoolean()
        Returns the property value as a boolean.
        Returns:
        string value
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object
      • equals

        public boolean equals​(Object obj)
        Equality is considered only on the basis of property name.
        Overrides:
        equals in class Object