T
- Type of object to holdpublic final class SmartProperty<T>
extends java.lang.Object
Object
instancesModifier and Type | Class and Description |
---|---|
static interface |
SmartProperty.IPropertyChangeListener
Defines the interface for
SmartProperty listener |
Constructor and Description |
---|
SmartProperty(SmartProperty.IPropertyChangeListener listener)
Creates a new instance of
SmartProperty class |
SmartProperty(SmartProperty.IPropertyChangeListener listener,
T defaultValue)
Creates a new instance of
SmartProperty class |
SmartProperty(SmartProperty<T> defaultValueSource,
SmartProperty.IPropertyChangeListener listener)
Creates a new instance of
SmartProperty class |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
T |
getValue()
Gets the current property value
|
int |
hashCode() |
void |
setStrongValue(T newValue)
Sets weak value for this property which overrides any previously set value
|
void |
setWeakValue(T newValue)
Sets weak value for this property if it was not overridden by
setStrongValue(Object) call |
java.lang.String |
toString() |
public SmartProperty(SmartProperty<T> defaultValueSource, @NonNull SmartProperty.IPropertyChangeListener listener)
SmartProperty
classdefaultValueSource
- Default value providerlistener
- The listener change listener for this propertypublic SmartProperty(@NonNull SmartProperty.IPropertyChangeListener listener, T defaultValue)
SmartProperty
classlistener
- The listener change listener for this propertydefaultValue
- The default value for propertypublic SmartProperty(@NonNull SmartProperty.IPropertyChangeListener listener)
SmartProperty
classlistener
- The listener change listener for this propertypublic void setWeakValue(T newValue)
setStrongValue(Object)
callnewValue
- The new value for propertypublic void setStrongValue(T newValue)
newValue
- The new value for propertypublic T getValue()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object