Interface PluralChangeModel<C,V>
- Type Parameters:
C
- The plural container type of represented by the change modelV
- The element type of the container represented by the change model
- All Superinterfaces:
ChangeModel<C>
- All Known Subinterfaces:
MapChangeModel<K,V>
public interface PluralChangeModel<C,V> extends ChangeModel<C>
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 Type Method Description <K, E> List<MapChangeModel<K,E>>
get(MapAttribute<V,K,E> attribute)
Deprecated.<K, E> List<MapChangeModel<K,E>>
get(MethodMapAttribute<V,K,E> attribute)
Returns the change models for the elements attribute.<E, C extends Collection<E>>
List<PluralChangeModel<C,E>>get(MethodPluralAttribute<V,C,E> attribute)
Returns the change models for the elements attribute.<X> List<SingularChangeModel<X>>
get(MethodSingularAttribute<V,X> attribute)
Returns the change models for the elements attribute.<E, C extends Collection<E>>
List<PluralChangeModel<C,E>>get(PluralAttribute<V,C,E> attribute)
Deprecated.<X> List<SingularChangeModel<X>>
get(SingularAttribute<V,X> attribute)
Deprecated.<X> List<? extends ChangeModel<X>>
get(String attributePath)
Returns the change models for the elements attribute.List<SingularChangeModel<V>>
getAddedElements()
Returns the change models of all added elements.List<SingularChangeModel<V>>
getElementChanges()
Returns the change models of all added, removed or mutated elements.List<SingularChangeModel<V>>
getMutatedElements()
Returns the change models of all mutated elements.List<SingularChangeModel<V>>
getRemovedElements()
Returns the change models of all removed elements.boolean
isChanged(String attributePath)
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
isDirty(String attributePath)
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
-
getElementChanges
List<SingularChangeModel<V>> getElementChanges()Returns the change models of all added, removed or mutated elements.- Returns:
- The dirty change models
-
getAddedElements
List<SingularChangeModel<V>> getAddedElements()Returns the change models of all added elements.- Returns:
- The dirty change models
-
getRemovedElements
List<SingularChangeModel<V>> getRemovedElements()Returns the change models of all removed elements.- Returns:
- The dirty change models
-
getMutatedElements
List<SingularChangeModel<V>> getMutatedElements()Returns the change models of all mutated elements.- Returns:
- The dirty change models
-
get
Returns the change models for the elements attribute.- Type Parameters:
X
- The element type of the singular attribute- 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 models for the elements 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 <E, C extends Collection<E>> List<PluralChangeModel<C,E>> get(PluralAttribute<V,C,E> attribute)Deprecated.Returns the change models for the elements attribute.- Type Parameters:
C
- The container type of the plural attributeE
- The value type of the plural attribute- Parameters:
attribute
- The collection attribute- Returns:
- The change model for the attribute
-
get
Deprecated.Returns the change models for the elements attribute.- Type Parameters:
K
- The key type of the map attributeE
- The value type of the map attribute- Parameters:
attribute
- The map attribute- Returns:
- The change model for the attribute
-
get
Returns the change models for the elements 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
<E, C extends Collection<E>> List<PluralChangeModel<C,E>> get(MethodPluralAttribute<V,C,E> attribute)Returns the change models for the elements attribute.- Type Parameters:
C
- The container type of the plural attributeE
- 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 models for the elements attribute.- Type Parameters:
K
- The key type of the map attributeE
- 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. This method always returnstrue
when the collection was altered i.e. objects removed or added. 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
-