public class PrivilegeBits extends Object
PrivilegeBits
Modifier and Type | Field and Description |
---|---|
static PrivilegeBits |
EMPTY |
Modifier and Type | Method and Description |
---|---|
void |
add(PrivilegeBits other)
Adds the other privilege bits to this instance.
|
void |
addDifference(PrivilegeBits a,
PrivilegeBits b)
Subtracts the
b from a and adds the result (diff)
to this instance. |
void |
diff(PrivilegeBits other)
Subtracts the other PrivilegeBits from the this.
If the specified bits do not intersect with this, it isn't modified. If this is included in other empty
privilege bits is returned. |
boolean |
equals(Object o) |
static PrivilegeBits |
getInstance()
Creates a mutable instance of privilege bits.
|
static PrivilegeBits |
getInstance(PrivilegeBits base)
Creates a mutable instance of privilege bits.
|
int |
hashCode() |
boolean |
includes(PrivilegeBits otherBits)
Returns
true if all privileges defined by the specified
otherBits are present in this instance. |
boolean |
includesRead()
Returns
true if this instance includes the jcr:read
privilege. |
boolean |
isEmpty()
Returns
true if this privilege bits includes no privileges
at all. |
boolean |
isModifiable()
Returns
true if this privilege bits instance can be altered. |
String |
toString() |
PrivilegeBits |
unmodifiable()
Returns an unmodifiable instance.
|
public static final PrivilegeBits EMPTY
public static PrivilegeBits getInstance()
public static PrivilegeBits getInstance(PrivilegeBits base)
base
- public boolean isEmpty()
true
if this privilege bits includes no privileges
at all.true
if this privilege bits includes no privileges
at all; false
otherwise.PrivilegeRegistry.NO_PRIVILEGE
public PrivilegeBits unmodifiable()
PrivilegeBits
instance.public boolean isModifiable()
true
if this privilege bits instance can be altered.public boolean includesRead()
true
if this instance includes the jcr:read
privilege. Shortcut for calling includes(PrivilegeBits)
where the other bits represented the jcr:read privilege.true
if this instance includes the jcr:read
privilege; false
otherwise.public boolean includes(PrivilegeBits otherBits)
true
if all privileges defined by the specified
otherBits
are present in this instance.otherBits
- true
if all privileges defined by the specified
otherBits
are included in this instance; false
otherwise.public void add(PrivilegeBits other)
other
- The other privilege bits to be added.UnsupportedOperationException
- if this instance is immutable.public void diff(PrivilegeBits other)
this
is included in other
empty
privilege bits is returned.other
- The other privilege bits to be substracted from this instance.UnsupportedOperationException
- if this instance is immutable.public void addDifference(PrivilegeBits a, PrivilegeBits b)
b
from a
and adds the result (diff)
to this instance.a
- An instance of privilege bits.b
- An instance of privilege bits.UnsupportedOperationException
- if this instance is immutable.Copyright © 2004-2020 The Apache Software Foundation. All Rights Reserved.