public static final class DOFPermission.Requestor extends DOFPermission
DOFPermission.ActAs, DOFPermission.ActAsAny, DOFPermission.Binding, DOFPermission.Define, DOFPermission.Factory, DOFPermission.IAm, DOFPermission.Provider, DOFPermission.Requestor, DOFPermission.TunnelDomain, DOFPermission.Unknown
Modifier and Type | Field and Description |
---|---|
static DOFPermission.Requestor |
INSTANCE
An instance of this class.
|
ACT_AS, BINDING, DEFINE, I_AM, PROVIDER, REQUESTOR, TUNNEL_DOMAIN
Constructor and Description |
---|
Requestor()
Create a new Requestor.
|
Requestor(DOFMarshalContext context,
java.lang.Object state,
DOFPacket packet)
Create an instance from serial form.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getBytes()
Get the serialized bytes of the permission.
|
DOFPermissionSet |
getComplement()
Return the complement permission for this permission.
|
short |
getPermissionType()
Returns the type of the permission.
|
boolean |
isAllowedBy(DOFPermission permission)
Returns whether or not this Permission is a subset of the permissions
allowed by the specified Permission.
|
boolean |
isAllowedBy(DOFPermissionSet permissionSet)
Returns whether or not this permission is a subset of the permissions
allowed by the specified permission set.
|
boolean |
isExplicit()
Returns whether or not this permission is considered explicit.
|
boolean |
isIntersection(DOFPermission permission)
Returns whether or not this permission has an intersection with the specified permission.
|
boolean |
isTerminal()
Returns whether or not this permission is a terminal permission.
|
void |
marshal(DOFMarshalContext context,
java.lang.Object state,
DOFPacket p)
Write an object to a serialized form to the specified buffer, according
to the context specified and with the given state.
|
DOFPermissionSet |
normalize()
Normalize this permission.
|
java.lang.String |
toString() |
addFactory, create, create, equals, hashCode
public static final DOFPermission.Requestor INSTANCE
public Requestor()
public Requestor(DOFMarshalContext context, java.lang.Object state, DOFPacket packet) throws DOFMarshalException
context
- The context of the unmarshalling to be performed.state
- The state in which the unmarshalling is done. This may affect the result.packet
- The buffer which contains the serialized form of the object. Must not be null.DOFMarshalException
- If there are errors in the data or the buffer. This is an exception to the rule that
non-RuntimeExceptions not be thrown from a constructor.Marshallable
public boolean isAllowedBy(DOFPermission permission)
DOFPermission
isAllowedBy
in class DOFPermission
permission
- The Permission to compare permissions against.public boolean isIntersection(DOFPermission permission)
DOFPermission
DOFPermission.normalize()
)
where either is allowed by the other.isIntersection
in class DOFPermission
permission
- The permission to determine an intersection.public boolean isAllowedBy(DOFPermissionSet permissionSet)
DOFPermission
isAllowedBy
in class DOFPermission
permissionSet
- The permission set to compare permissions against.public boolean isTerminal()
DOFPermission
isTerminal
in class DOFPermission
public boolean isExplicit()
DOFPermission
DOFPermission.isAllowedBy(DOFPermission)
unless ALL permissions are known.isExplicit
in class DOFPermission
public DOFPermissionSet normalize()
DOFPermission
normalize
in class DOFPermission
public DOFPermissionSet getComplement()
DOFPermission
DOFPermission.REQUESTOR
is
the complement of DOFPermission.PROVIDER
.getComplement
in class DOFPermission
public short getPermissionType()
DOFPermission
getPermissionType
in class DOFPermission
public void marshal(DOFMarshalContext context, java.lang.Object state, DOFPacket p) throws DOFMarshalException
DOFPermission
marshal
in interface org.opendof.core.internal.protocol.Marshallable
marshal
in class DOFPermission
context
- The context of the marshaling to be performed.state
- The state in which the marshalling is done. This may affect the result.p
- The buffer which will receive the marshaled data. Must not be null.DOFMarshalException
- If there are errors in the data or the buffer.public byte[] getBytes()
DOFPermission
getBytes
in class DOFPermission
public java.lang.String toString()
toString
in class java.lang.Object