Interface MapChangeModel<K,V>
- Type Parameters:
K
- The key type of the map represented by the change modelV
- The element type of the map represented by the change model
- All Superinterfaces:
ChangeModel<Map<K,V>>
,PluralChangeModel<Map<K,V>,V>
public interface MapChangeModel<K,V> extends PluralChangeModel<Map<K,V>,V>
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 List<SingularChangeModel<K>>
getAddedKeys()
Returns the change models of all added keys.List<SingularChangeModel<?>>
getAddedObjects()
Returns the change models of all added keys and elements.List<SingularChangeModel<K>>
getKeyChanges()
Returns the change models of all added, removed or mutated keys.List<SingularChangeModel<K>>
getMutatedKeys()
Returns the change models of all mutated keys.List<SingularChangeModel<?>>
getMutatedObjects()
Returns the change models of all mutated keys and elements.List<SingularChangeModel<?>>
getObjectChanges()
Returns the change models of all added, removed or mutated keys and elements.List<SingularChangeModel<K>>
getRemovedKeys()
Returns the change models of all removed keys.List<SingularChangeModel<?>>
getRemovedObjects()
Returns the change models of all removed keys and elements.boolean
isKeyChanged(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
isKeyDirty(String attributePath)
Returns whether the change model for the keys attribute is dirty.<K1, V1> List<MapChangeModel<K1,V1>>
keyGet(MapAttribute<K,K1,V1> attribute)
Deprecated.<K1, V1> List<MapChangeModel<K1,V1>>
keyGet(MethodMapAttribute<K,K1,V1> attribute)
Returns the change models for the keys attribute.<E, C extends Collection<E>>
List<PluralChangeModel<C,E>>keyGet(MethodPluralAttribute<K,C,E> attribute)
Returns the change models for the keys attribute.<X> List<SingularChangeModel<X>>
keyGet(MethodSingularAttribute<K,X> attribute)
Returns the change models for the keys attribute.<E, C extends Collection<E>>
List<PluralChangeModel<C,E>>keyGet(PluralAttribute<K,C,E> attribute)
Deprecated.<X> List<SingularChangeModel<X>>
keyGet(SingularAttribute<K,X> attribute)
Deprecated.<X> List<? extends ChangeModel<X>>
keyGet(String attributePath)
Returns the change models for the keys attribute.Methods inherited from interface com.blazebit.persistence.view.change.ChangeModel
getCurrentState, getInitialState, getKind, isDirty
Methods inherited from interface com.blazebit.persistence.view.change.PluralChangeModel
get, get, get, get, get, get, get, getAddedElements, getElementChanges, getMutatedElements, getRemovedElements, isChanged, isDirty
-
Method Details
-
getKeyChanges
List<SingularChangeModel<K>> getKeyChanges()Returns the change models of all added, removed or mutated keys.- Returns:
- The dirty change models
-
getAddedKeys
List<SingularChangeModel<K>> getAddedKeys()Returns the change models of all added keys.- Returns:
- The dirty change models
-
getRemovedKeys
List<SingularChangeModel<K>> getRemovedKeys()Returns the change models of all removed keys.- Returns:
- The dirty change models
-
getMutatedKeys
List<SingularChangeModel<K>> getMutatedKeys()Returns the change models of all mutated keys.- Returns:
- The dirty change models
-
getObjectChanges
List<SingularChangeModel<?>> getObjectChanges()Returns the change models of all added, removed or mutated keys and elements.- Returns:
- The dirty change models
-
getAddedObjects
List<SingularChangeModel<?>> getAddedObjects()Returns the change models of all added keys and elements.- Returns:
- The dirty change models
-
getRemovedObjects
List<SingularChangeModel<?>> getRemovedObjects()Returns the change models of all removed keys and elements.- Returns:
- The dirty change models
-
getMutatedObjects
List<SingularChangeModel<?>> getMutatedObjects()Returns the change models of all mutated keys and elements.- Returns:
- The dirty change models
-
keyGet
Returns the change models for the keys 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
-
keyGet
Deprecated.Returns the change models for the keys attribute.- Type Parameters:
X
- The element type of the singular attribute- Parameters:
attribute
- The singular attribute- Returns:
- The change model for the attribute
-
keyGet
@Deprecated <E, C extends Collection<E>> List<PluralChangeModel<C,E>> keyGet(PluralAttribute<K,C,E> attribute)Deprecated.Returns the change models for the keys 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
-
keyGet
Deprecated.Returns the change models for the keys attribute.- Type Parameters:
K1
- The key type of the map attributeV1
- The value type of the map attribute- Parameters:
attribute
- The map attribute- Returns:
- The change model for the attribute
-
keyGet
Returns the change models for the keys 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
-
keyGet
<E, C extends Collection<E>> List<PluralChangeModel<C,E>> keyGet(MethodPluralAttribute<K,C,E> attribute)Returns the change models for the keys 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
-
keyGet
Returns the change models for the keys attribute.- Type Parameters:
K1
- The key type of the map attributeV1
- The value type of the map attribute- Parameters:
attribute
- The map attribute- Returns:
- The change model for the attribute
- Since:
- 1.5.0
-
isKeyDirty
Returns whether the change model for the keys attribute is dirty. Essentially, this is a more efficient short-hand forkeyGet(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
-
isKeyChanged
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
-