org.nuiton.topia.framework
Class EntityState

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

public class EntityState
extends Object
implements Comparable<EntityState>

Used to know the state of entity during transaction.

Author:
poussin

Field Summary
protected  int state
          internal representation of all states of entity (use bitwise operation).
 
Constructor Summary
EntityState()
           
 
Method Summary
 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 Detail

state

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

Constructor Detail

EntityState

public EntityState()
Method Detail

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 Comparable<EntityState>


Copyright © 2004-2012 CodeLutin. All Rights Reserved.