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 boolean
equals(java.lang.Object obj)
java.lang.Class<? extends T>
getClazz()
T
getDefaultValue()
The default value for new instances of this property, or null if not applicable.java.lang.String
getName()
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.int
hashCode()
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.void
setClazz(java.lang.Class<?> clazz)
BasicProperty<T>
setClazz_(java.lang.Class<?> clazz)
Chaining versionvoid
setDefaultValue(java.lang.Object defaultValue)
BasicProperty<T>
setDefaultValue_(java.lang.Object defaultValue)
Chaining versionvoid
setName(java.lang.String name)
BasicProperty<T>
setName_(java.lang.String name)
Chaining versionjava.lang.String
toString()
-
-
-
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:Property
The default value for new instances of this property, or null if not applicable.- Specified by:
getDefaultValue
in 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:Property
The 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:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toString
in 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
-
-