Class EntityState

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

public class EntityState
extends java.lang.Object
implements java.lang.Comparable<EntityState>
Used to know the state of entity during transaction.
Author:
poussin <poussin@codelutin.com>
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected int state
    internal representation of all states of entity (use bitwise operation).
  • Constructor Summary

    Constructors 
    Constructor Description
    EntityState()  
  • Method Summary

    Modifier and Type Method Description
    void addCreate()
    Add create state.
    void addDelete()
    Add delete state.
    void addLoad()
    Add load state.
    void addRead()
    Add read state After the invocation, method isRead() will always return true.
    void addUpdate()
    Add update state.
    int compareTo​(EntityState o)  
    boolean isCreate()
    Tells if the #CREATE state is on.
    boolean isDelete()
    Tells if the #DELETE state is on.
    boolean isLoad()
    Tells if the #LOAD state is on.
    boolean isRead()
    Tells if the #READ state is on.
    boolean isUpdate()
    Tells if the #UPDATE state is on.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • state

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

  • Method Details

    • addLoad

      public void addLoad()
      Add load state. After the invocation, method isLoad() will always return true.
    • addRead

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

      public void addCreate()
      Add create state. After the invocation, method isCreate() will always return true.
    • addUpdate

      public void addUpdate()
      Add update state. After the invocation, method isUpdate() will always return true.
    • addDelete

      public void addDelete()
      Add delete state. After the invocation, method isDelete() will always return true.
    • isLoad

      public boolean isLoad()
      Tells if the #LOAD state is on.
      Returns:
      true if #LOAD 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.
    • isCreate

      public boolean isCreate()
      Tells if the #CREATE state is on.
      Returns:
      true if #CREATE state is on, false otherwise.
    • isUpdate

      public boolean isUpdate()
      Tells if the #UPDATE state is on.
      Returns:
      true if #UPDATE state is on, false otherwise.
    • isDelete

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

      public int compareTo​(EntityState o)
      Specified by:
      compareTo in interface java.lang.Comparable<EntityState>