Class EntityState

java.lang.Object
org.nuiton.topia.persistence.event.EntityState
All Implemented Interfaces:
Comparable<EntityState>

public class EntityState extends Object implements Comparable<EntityState>
Used to know the state of an entity during transaction.
Author:
Benjamin Poussin - poussin@codelutin.com, Arnaud Thimel (Code Lutin)
  • Field Details

    • state

      protected int state
      Internal representation of all states of entity (use bitwise operation).
  • Constructor Details

    • EntityState

      public EntityState()
  • Method Details

    • addLoaded

      public void addLoaded()
      Add loaded state. After the invocation, method isLoaded() will always return true.
    • addRead

      public void addRead()
      Add read state After the invocation, method isRead() will always return true.
    • addCreated

      public void addCreated()
      Add created state. After the invocation, method isCreated() will always return true.
    • addUpdated

      public void addUpdated()
      Add updated state. After the invocation, method isUpdated() will always return true.
    • addWritten

      public void addWritten()
      Add written state. After the invocation, method isWritten() will always return true.
    • addDeleted

      public void addDeleted()
      Add deleted state. After the invocation, method isDeleted() will always return true.
    • isLoaded

      public boolean isLoaded()
      Tells if the #LOADED state is on.
      Returns:
      true if #LOADED state is on, false otherwise.
    • isRead

      public boolean isRead()
      Tells if the #READ state is on.
      Returns:
      true if #READ state is on, false otherwise.
    • isCreated

      public boolean isCreated()
      Tells if the #CREATED state is on.
      Returns:
      true if #CREATED state is on, false otherwise.
    • isWritten

      public boolean isWritten()
      Tells if the #WRITTEN state is on.
      Returns:
      true if #WRITTEN state is on, false otherwise.
    • isUpdated

      public boolean isUpdated()
      Tells if the #UPDATED state is on.
      Returns:
      true if #UPDATED state is on, false otherwise.
    • isDeleted

      public boolean isDeleted()
      Tells if the #DELETED state is on.
      Returns:
      true if #DELETED state is on, false otherwise.
    • compareTo

      public int compareTo(EntityState o)
      Specified by:
      compareTo in interface Comparable<EntityState>
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object