/* Generated by Together */ package multimonster.common; import java.io.Serializable; /** * Use: 1 * Modify: 2 * Delete: 4 * RightCh: 8 * * sum of different combinations of rights is always unique */ public class Action implements Serializable{ public final static int A_USE = 1; public final static int A_MODIFY = 2; public final static int A_DELETE = 3; public final static int A_CHANGERIGHT = 4; private boolean use; private boolean modify; private boolean delete; private boolean changeRight; /** * Sets the Action according to the given constant. * (see static constants in this class) */ public Action(int action) { setUse(false); setModify(false); setDelete(false); setChangeRight(false); switch (action) { case A_USE : setUse(true); break; case A_MODIFY : setModify(true); break; case A_DELETE : setDelete(true); break; case A_CHANGERIGHT : setChangeRight(true); break; default : break; } } /** * @return */ public boolean isChangeRight() { return changeRight; } /** * @return */ public boolean isDelete() { return delete; } /** * @return */ public boolean isModify() { return modify; } /** * @return */ public boolean isUse() { return use; } /** * @param b */ public void setChangeRight(boolean b) { changeRight = b; } /** * @param b */ private void setDelete(boolean b) { delete = b; } /** * @param b */ private void setModify(boolean b) { modify = b; } /** * @param b */ private void setUse(boolean b) { use = b; } }