Constructor and Description |
---|
Record(M model)
Creates a new record that wraps the given model.
|
Modifier and Type | Method and Description |
---|---|
<V> void |
addChange(ValueProvider<? super M,V> property,
V value)
Adds a change to the data in this Record.
|
void |
commit(boolean fireEvent)
Commits the changes to the model tracked by this record.
|
<V> Store.Change<M,V> |
getChange(ValueProvider<? super M,V> property)
Gets the current Change object applied to that property, if any.
|
Collection<Store.Change<M,?>> |
getChanges()
Returns all changes.
|
M |
getModel()
Returns the wrapped model instance.
|
<V> V |
getValue(ValueProvider<? super M,V> property)
Gets the current value of this property in the record, whether it is
saved or not.
|
boolean |
isDirty()
Returns true if the record has uncommitted changes.
|
void |
revert()
Rejects all changes made to the Record since either creation, or the last
commit operation.
|
void |
revert(ValueProvider<? super M,?> property)
Rejects a single change made to the Record since its creation, or since
the last commit operation.
|
public Record(M model)
model
- the model to be wrapped by this recordpublic <V> void addChange(ValueProvider<? super M,V> property, V value)
V
- the value type (for the changed property in the model)property
- the property to changevalue
- the changed valuepublic void commit(boolean fireEvent)
fireEvent
- whether or not a StoreUpdateEvent
should be firedpublic <V> Store.Change<M,V> getChange(ValueProvider<? super M,V> property)
V
- the value type (for the changed property in the model)property
- the changed propertypublic Collection<Store.Change<M,?>> getChanges()
public M getModel()
public <V> V getValue(ValueProvider<? super M,V> property)
V
- the value type (for the property in the model)property
- the property containing the value to getpublic boolean isDirty()
public void revert(ValueProvider<? super M,?> property)
StoreUpdateEvent
if a change is made.property
- the property of the model to revertpublic void revert()
Copyright © 2018. All rights reserved.