Class BasicProperty<T>
- java.lang.Object
-
- com.inductiveautomation.ignition.common.config.BasicProperty<T>
-
- All Implemented Interfaces:
Property<T>,java.io.Serializable
- Direct Known Subclasses:
BasicDescriptiveProperty,Parameter,RuntimeParameter
public class BasicProperty<T> extends java.lang.Object implements Property<T>
A basic implementation ofProperty. Somewhat special in that hashCode and equals are implemented in order to match up with other Properties with the same name.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description BasicProperty()Bean compatibility...BasicProperty(Property<T> copy)BasicProperty(java.lang.String name, java.lang.Class<? extends T> cls)BasicProperty(java.lang.String name, java.lang.Class<? extends T> cls, T defaultValue)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)java.lang.Class<? extends T>getClazz()TgetDefaultValue()The default value for new instances of this property, or null if not applicable.java.lang.StringgetName()Final because if this was overridden then the hashcode calculated in the ctor would be wrongjava.lang.Class<? extends T>getType()The data type for this property.inthashCode()We override hashCode and equals in a special way to only look at a name.static BasicProperty<java.lang.Object>of(java.lang.String name)Returns a new basic property with the given name, object type, and null value.voidsetClazz(java.lang.Class<?> clazz)BasicProperty<T>setClazz_(java.lang.Class<?> clazz)Chaining versionvoidsetDefaultValue(java.lang.Object defaultValue)BasicProperty<T>setDefaultValue_(java.lang.Object defaultValue)Chaining versionvoidsetName(java.lang.String name)BasicProperty<T>setName_(java.lang.String name)Chaining versionjava.lang.StringtoString()
-
-
-
Method Detail
-
of
public static BasicProperty<java.lang.Object> of(java.lang.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:PropertyThe default value for new instances of this property, or null if not applicable.- Specified by:
getDefaultValuein interfaceProperty<T>
-
getName
public final java.lang.String getName()
Final because if this was overridden then the hashcode calculated in the ctor would be wrong
-
getType
public java.lang.Class<? extends T> getType()
Description copied from interface:PropertyThe data type for this property.
-
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:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getClazz
public java.lang.Class<? extends T> getClazz()
-
setClazz
public void setClazz(java.lang.Class<?> clazz)
-
setName
public void setName(java.lang.String name)
-
setDefaultValue
public void setDefaultValue(java.lang.Object defaultValue)
-
setClazz_
public BasicProperty<T> setClazz_(java.lang.Class<?> clazz)
Chaining version
-
setName_
public BasicProperty<T> setName_(java.lang.String name)
Chaining version
-
setDefaultValue_
public BasicProperty<T> setDefaultValue_(java.lang.Object defaultValue)
Chaining version
-
-