Interface SingularChangeModel<E>
- Type Parameters:
E
- The element type represented by the change model
- All Superinterfaces:
ChangeModel<E>
An interface for accessing the dirty state of an object.
- Since:
- 1.2.0
- Author:
- Christian Beikov
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.blazebit.persistence.view.change.ChangeModel
ChangeModel.ChangeKind
-
Method Summary
Modifier and TypeMethodDescription<K,
V> MapChangeModel<K, V> get
(MapAttribute<E, K, V> attribute) Deprecated.<K,
V> MapChangeModel<K, V> get
(MethodMapAttribute<E, K, V> attribute) Returns the change model for the attribute.<V,
C extends Collection<V>>
PluralChangeModel<C,V> get
(MethodPluralAttribute<E, C, V> attribute) Returns the change model for the attribute.<X> SingularChangeModel<X>
get
(MethodSingularAttribute<E, X> attribute) Returns the change model for the attribute.<V,
C extends Collection<V>>
PluralChangeModel<C,V> get
(PluralAttribute<E, C, V> attribute) Deprecated.<X> SingularChangeModel<X>
get
(SingularAttribute<E, X> attribute) Deprecated.<X> ChangeModel<X>
Returns the change model for the attribute.<X> List<? extends ChangeModel<X>>
Returns the change model for the attribute.List<ChangeModel<?>>
Returns the change models of the dirty nested attributes.boolean
Returns whether the target attribute path was changed by updating or mutating it, but still has the same identity regarding parent objects it is contained in.boolean
Returns whether the change model for the attribute is dirty.Methods inherited from interface com.blazebit.persistence.view.change.ChangeModel
getCurrentState, getInitialState, getKind, isDirty
-
Method Details
-
getDirtyChanges
List<ChangeModel<?>> getDirtyChanges()Returns the change models of the dirty nested attributes.- Returns:
- The dirty change models
- Throws:
IllegalStateException
- if invoked on a change model that corresponds to a basic attribute
-
get
Returns the change model for the attribute.- Type Parameters:
X
- The element type of the target attribute path- Parameters:
attributePath
- The name of the attribute or path to sub-attribute- Returns:
- The change model for the attribute
- Throws:
IllegalStateException
- if invoked on a change model that corresponds to a basic attributeIllegalArgumentException
- if attribute of the given name does not otherwise exist
-
getAll
Returns the change model for the attribute.- Type Parameters:
X
- The element type of the target attribute path- Parameters:
attributePath
- The name of the attribute or path to sub-attribute- Returns:
- The change model for the attribute
- Throws:
IllegalStateException
- if invoked on a change model that corresponds to a basic attributeIllegalArgumentException
- if attribute of the given name does not otherwise exist
-
get
Deprecated.Returns the change model for the attribute.- Type Parameters:
X
- The element type of the singular attribute- Parameters:
attribute
- The singular attribute- Returns:
- The change model for the attribute
-
get
@Deprecated <V,C extends Collection<V>> PluralChangeModel<C,V> get(PluralAttribute<E, C, V> attribute) Deprecated.Returns the change model for the attribute.- Type Parameters:
C
- The container type of the plural attributeV
- The value type of the plural attribute- Parameters:
attribute
- The collection attribute- Returns:
- The change model for the attribute
-
get
Deprecated.Returns the change model for the attribute.- Type Parameters:
K
- The key type of the map attributeV
- The value type of the map attribute- Parameters:
attribute
- The map attribute- Returns:
- The change model for the attribute
-
get
Returns the change model for the attribute.- Type Parameters:
X
- The element type of the singular attribute- Parameters:
attribute
- The singular attribute- Returns:
- The change model for the attribute
- Since:
- 1.5.0
-
get
Returns the change model for the attribute.- Type Parameters:
C
- The container type of the plural attributeV
- The value type of the plural attribute- Parameters:
attribute
- The collection attribute- Returns:
- The change model for the attribute
- Since:
- 1.5.0
-
get
Returns the change model for the attribute.- Type Parameters:
K
- The key type of the map attributeV
- The value type of the map attribute- Parameters:
attribute
- The map attribute- Returns:
- The change model for the attribute
- Since:
- 1.5.0
-
isDirty
Returns whether the change model for the attribute is dirty. Essentially, this is a more efficient short-hand forget(attributePath).isDirty()
.- Parameters:
attributePath
- The name of the attribute or path to sub-attribute- Returns:
- True if the change model for the attribute path is dirty, false otherwise
- Throws:
IllegalStateException
- if invoked on a change model that corresponds to a basic attributeIllegalArgumentException
- if attribute of the given name does not otherwise exist
-
isChanged
Returns whether the target attribute path was changed by updating or mutating it, but still has the same identity regarding parent objects it is contained in. If any of the parent objects as denoted by the attribute path are updated i.e. the identity was changed, this returnstrue
. Mutations or updates to the target object also causetrue
to be returned. In all other cases, this method returnsfalse
.- Parameters:
attributePath
- The name of the attribute or path to sub-attribute- Returns:
- True if the attribute was changed, false otherwise
- Throws:
IllegalStateException
- if invoked on a change model that corresponds to a basic attributeIllegalArgumentException
- if attribute of the given name does not otherwise exist
-
get(MethodMapAttribute)