Interface PluralChangeModel<C,​V>

Type Parameters:
C - The plural container type of represented by the change model
V - 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
  • 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

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

      @Deprecated <X> List<SingularChangeModel<X>> get​(SingularAttribute<V,​X> attribute)
      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)
      Returns the change models for the elements 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
    • get

      @Deprecated <K,​ E> List<MapChangeModel<K,​E>> get​(MapAttribute<V,​K,​E> attribute)
      Deprecated.
      Returns the change models for the elements attribute.
      Type Parameters:
      K - The key type of the map attribute
      E - The value type of the map attribute
      Parameters:
      attribute - The map attribute
      Returns:
      The change model for the attribute
    • get

      <X> List<SingularChangeModel<X>> get​(MethodSingularAttribute<V,​X> attribute)
      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 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
    • get

      <K,​ E> List<MapChangeModel<K,​E>> get​(MethodMapAttribute<V,​K,​E> attribute)
      Returns the change models for the elements attribute.
      Type Parameters:
      K - The key type of the map attribute
      E - The value type of the map attribute
      Parameters:
      attribute - The map attribute
      Returns:
      The change model for the attribute
      Since:
      1.5.0
    • isDirty

      boolean isDirty​(String attributePath)
      Returns whether the change model for the attribute is dirty. Essentially, this is a more efficient short-hand for get(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
    • isChanged

      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. 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