Package org.nuiton.topia.framework
Class EntityState
java.lang.Object
org.nuiton.topia.framework.EntityState
- All Implemented Interfaces:
Comparable<EntityState>
Used to know the state of entity during transaction.
- Author:
- poussin <poussin@codelutin.com>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected intinternal representation of all states of entity (use bitwise operation). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd create state.voidAdd delete state.voidaddLoad()Add load state.voidaddRead()Add read state After the invocation, methodisRead()will always returntrue.voidAdd update state.intbooleanisCreate()Tells if the#CREATEstate is on.booleanisDelete()Tells if the#DELETEstate is on.booleanisLoad()Tells if the#LOADstate is on.booleanisRead()Tells if the#READstate is on.booleanisUpdate()Tells if the#UPDATEstate is on.
-
Field Details
-
state
protected int stateinternal representation of all states of entity (use bitwise operation).
-
-
Constructor Details
-
EntityState
public EntityState()
-
-
Method Details
-
addLoad
public void addLoad()Add load state. After the invocation, methodisLoad()will always returntrue. -
addRead
public void addRead()Add read state After the invocation, methodisRead()will always returntrue. -
addCreate
public void addCreate()Add create state. After the invocation, methodisCreate()will always returntrue. -
addUpdate
public void addUpdate()Add update state. After the invocation, methodisUpdate()will always returntrue. -
addDelete
public void addDelete()Add delete state. After the invocation, methodisDelete()will always returntrue. -
isLoad
public boolean isLoad()Tells if the#LOADstate is on.- Returns:
trueif#LOADstate is on,falseotherwise.
-
isRead
public boolean isRead()Tells if the#READstate is on.- Returns:
trueif#READstate is on,falseotherwise.
-
isCreate
public boolean isCreate()Tells if the#CREATEstate is on.- Returns:
trueif#CREATEstate is on,falseotherwise.
-
isUpdate
public boolean isUpdate()Tells if the#UPDATEstate is on.- Returns:
trueif#UPDATEstate is on,falseotherwise.
-
isDelete
public boolean isDelete()Tells if the#DELETEstate is on.- Returns:
trueif#DELETEstate is on,falseotherwise.
-
compareTo
- Specified by:
compareToin interfaceComparable<EntityState>
-