Package com.kii.cloud.storage
Class KiiACLEntry
- java.lang.Object
-
- com.kii.cloud.storage.KiiACLEntry
-
public final class KiiACLEntry extends java.lang.ObjectEntry of ACL.
-
-
Constructor Summary
Constructors Constructor Description KiiACLEntry(KiiSubject subject, KiiACL.Action action, boolean grant)Creates an ACL Entry.KiiACLEntry(java.lang.Object parent, KiiSubject subject, KiiACL.Action action, boolean grant)Creates an ACL Entry with specified parent object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object that)Conditions of two ACLEntry object regarded as same:
- Parent object type is same and has same ID.
- Subject object type is same and has same ID.
- Has same Action
- Has same state of granted/ revokedKiiACL.ActiongetAction()Returns the action of the ACL entry.KiiSubjectgetSubject()Returns the subject of the ACL entry.booleangrant()Checks whether the entry is for grant/revoke.inthashCode()voidsetAction(KiiACL.Action action)Set action of this ACLEntriy.voidsetGrant(boolean grant)Set operation grant/revoke of this ACLEntriy.voidsetSubject(KiiSubject subject)Set subject of this ACLEntriy.
-
-
-
Constructor Detail
-
KiiACLEntry
public KiiACLEntry(@NonNull KiiSubject subject, @NonNull KiiACL.Action action, boolean grant)Creates an ACL Entry.- Parameters:
subject- Subject of this operation.KiiSubjectaction- Action to be grant/revoked.grant- true for grant, false for revoke.
-
KiiACLEntry
public KiiACLEntry(@NonNull java.lang.Object parent, @NonNull KiiSubject subject, @NonNull KiiACL.Action action, boolean grant)Creates an ACL Entry with specified parent object. Usually you may just useKiiACLEntry(com.kii.cloud.storage.KiiSubject,com.kii.cloud.storage.KiiACL.Action,boolean). This is useful to check whether the specific KiiACLEntry is contained or not in the Set returned byKiiACL.listACLEntries()with method Set#contains().- Parameters:
parent- object of which ACL is operated.subject- subject of which specified action is granted or revoked.action- action to be granted/revoked.grant- true for grant, false for revoke.
-
-
Method Detail
-
setSubject
public void setSubject(@NonNull KiiSubject subject)Set subject of this ACLEntriy.- Parameters:
subject-
-
setAction
public void setAction(@NonNull KiiACL.Action action)Set action of this ACLEntriy.- Parameters:
action-
-
setGrant
public void setGrant(boolean grant)
Set operation grant/revoke of this ACLEntriy.- Parameters:
grant- true for grant, false for revoke.
-
getSubject
@NonNull public KiiSubject getSubject()
Returns the subject of the ACL entry.
-
getAction
@NonNull public KiiACL.Action getAction()
Returns the action of the ACL entry.
-
grant
public boolean grant()
Checks whether the entry is for grant/revoke.
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object that)
Conditions of two ACLEntry object regarded as same:
- Parent object type is same and has same ID.
- Subject object type is same and has same ID.
- Has same Action
- Has same state of granted/ revoked- Overrides:
equalsin classjava.lang.Object- Parameters:
that- object to be compared.- Returns:
- whether the object is equals to this ACLEntry or not.
-
-