Interface MapChangeModel<K,​V>

  • Type Parameters:
    K - The key type of the map represented by the change model
    V - 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
    • Method Detail

      • 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

        <X> List<? extends ChangeModel<X>> keyGet​(String attributePath)
        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 attribute
        IllegalArgumentException - if attribute of the given name does not otherwise exist
      • keyGet

        @Deprecated
        <K1,​V1> List<MapChangeModel<K1,​V1>> keyGet​(MapAttribute<K,​K1,​V1> attribute)
        Returns the change models for the keys attribute.
        Type Parameters:
        K1 - The key type of the map attribute
        V1 - The value type of the map attribute
        Parameters:
        attribute - The map attribute
        Returns:
        The change model for the attribute
      • keyGet

        <X> List<SingularChangeModel<X>> keyGet​(MethodSingularAttribute<K,​X> attribute)
        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 attribute
        E - The value type of the plural attribute
        Parameters:
        attribute - The collection attribute
        Returns:
        The change model for the attribute
        Since:
        1.5.0
      • keyGet

        <K1,​V1> List<MapChangeModel<K1,​V1>> keyGet​(MethodMapAttribute<K,​K1,​V1> attribute)
        Returns the change models for the keys attribute.
        Type Parameters:
        K1 - The key type of the map attribute
        V1 - The value type of the map attribute
        Parameters:
        attribute - The map attribute
        Returns:
        The change model for the attribute
        Since:
        1.5.0
      • isKeyDirty

        boolean isKeyDirty​(String attributePath)
        Returns whether the change model for the keys attribute is dirty. Essentially, this is a more efficient short-hand for keyGet(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 attribute
        IllegalArgumentException - if attribute of the given name does not otherwise exist
      • isKeyChanged

        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. If any of the parent objects as denoted by the attribute path are updated i.e. the identity was changed, this returns true. Mutations or updates to the target object also cause true to be returned. This method always returns true when the collection was altered i.e. objects removed or added. In all other cases, this method returns false.
        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 attribute
        IllegalArgumentException - if attribute of the given name does not otherwise exist