public abstract class AbstractResetableProperty<T> extends Object implements ResetableProperty<T>
Type | Property and Description |
---|---|
BooleanBinding |
dirty
A property that tracks if the current value differs form the base value.
|
protected abstract Property<T> |
writableBaseValue |
baseValue, value
Modifier and Type | Field and Description |
---|---|
protected BooleanBinding |
dirty |
Constructor and Description |
---|
AbstractResetableProperty()
The constructor of
AbstractResetableProperty |
AbstractResetableProperty(Object bean,
String name)
The constructor of
AbstractResetableProperty |
AbstractResetableProperty(Object bean,
String name,
T baseValue)
The constructor of
AbstractResetableProperty |
AbstractResetableProperty(T baseValue)
The constructor of
AbstractResetableProperty |
Modifier and Type | Method and Description |
---|---|
protected boolean |
checkValuesAreNotEqual() |
protected BooleanBinding |
createDirtyBinding() |
BooleanBinding |
dirtyProperty()
A property that tracks if the current value differs form the base value.
|
T |
getBaseValue()
Returns the base value of this
ResetableProperty . |
Object |
getBean()
Returns the
Object that contains this property. |
String |
getName()
Returns the name of this property.
|
T |
getValue()
Returns the current value of this
ResetableProperty . |
boolean |
isDirty()
Query if the current value differs from the base value.
|
ResetableProperty<T> |
rebase()
Sets the current value as the base value.
|
ResetableProperty<T> |
reset()
Sets the base value as the current value.
|
ResetableProperty<T> |
setValue(T value)
Sets the current value.
|
protected abstract Property<T> |
writableBaseValueProperty() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
baseValueProperty, valueProperty
public BooleanBinding dirtyProperty
dirtyProperty
in interface ResetableProperty<T>
protected final BooleanBinding dirty
public AbstractResetableProperty()
AbstractResetableProperty
public AbstractResetableProperty(@Nullable T baseValue)
AbstractResetableProperty
baseValue
- the base value of this AbstractResetableProperty
public AbstractResetableProperty(@Nullable Object bean, @Nonnull String name)
AbstractResetableProperty
bean
- the bean of this AbstractResetableProperty
name
- the name of this AbstractResetableProperty
public AbstractResetableProperty(@Nullable Object bean, @Nonnull String name, @Nullable T baseValue)
AbstractResetableProperty
bean
- the bean of this AbstractResetableProperty
name
- the name of this AbstractResetableProperty
baseValue
- the base value of this AbstractResetableProperty
protected BooleanBinding createDirtyBinding()
protected boolean checkValuesAreNotEqual()
public BooleanBinding dirtyProperty()
ResetableProperty
dirtyProperty
in interface ResetableProperty<T>
@Nullable public T getBaseValue()
ResetableProperty
ResetableProperty
.getBaseValue
in interface ResetableProperty<T>
@Nullable public T getValue()
ResetableProperty
ResetableProperty
.getValue
in interface ResetableProperty<T>
public ResetableProperty<T> setValue(@Nullable T value)
ResetableProperty
setValue
in interface ResetableProperty<T>
value
- the new valuepublic boolean isDirty()
ResetableProperty
isDirty
in interface ResetableProperty<T>
true
if values differ, false
otherwisepublic ResetableProperty<T> rebase()
ResetableProperty
rebase
in interface ResetableProperty<T>
ResetableProperty
public ResetableProperty<T> reset()
ResetableProperty
reset
in interface ResetableProperty<T>
ResetableProperty
@Nullable public Object getBean()
ResetableProperty
Object
that contains this property. If this property
is not contained in an Object
, null
is returned.getBean
in interface ResetableProperty<T>
Object
or null
public String getName()
ResetableProperty
String
.getName
in interface ResetableProperty<T>
String