Class BasicProperty<T>

java.lang.Object
com.inductiveautomation.ignition.common.config.BasicProperty<T>
All Implemented Interfaces:
Property<T>, Serializable
Direct Known Subclasses:
BasicDescriptiveProperty, Parameter, RuntimeParameter

public class BasicProperty<T> extends Object implements Property<T>
A basic implementation of Property. Somewhat special in that hashCode and equals are implemented in order to match up with other Properties with the same name.
See Also:
  • Constructor Details

    • BasicProperty

      public BasicProperty()
      Bean compatibility...
    • BasicProperty

      public BasicProperty(String name, Class<? extends T> cls)
    • BasicProperty

      public BasicProperty(String name, Class<? extends T> cls, T defaultValue)
    • BasicProperty

      public BasicProperty(Property<T> copy)
  • Method Details

    • of

      public static BasicProperty<Object> of(String name)
      Returns a new basic property with the given name, object type, and null value. Mainly used for looking up other defined properties.
    • getDefaultValue

      public T getDefaultValue()
      Description copied from interface: Property
      The default value for new instances of this property, or null if not applicable.
      Specified by:
      getDefaultValue in interface Property<T>
    • getName

      public final String getName()
      Final because if this was overridden then the hashcode calculated in the ctor would be wrong
      Specified by:
      getName in interface Property<T>
    • getType

      public Class<? extends T> getType()
      Description copied from interface: Property
      The data type for this property.
      Specified by:
      getType in interface Property<T>
    • hashCode

      public int hashCode()
      We override hashCode and equals in a special way to only look at a name. So, different implementations of a particular property will be considered equivilent.
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getClazz

      public Class<? extends T> getClazz()
    • setClazz

      public void setClazz(Class<?> clazz)
    • setName

      public void setName(String name)
    • setDefaultValue

      public void setDefaultValue(Object defaultValue)
    • setClazz_

      public BasicProperty<T> setClazz_(Class<?> clazz)
      Chaining version
    • setName_

      public BasicProperty<T> setName_(String name)
      Chaining version
    • setDefaultValue_

      public BasicProperty<T> setDefaultValue_(Object defaultValue)
      Chaining version