Class PrivilegeBits
- java.lang.Object
-
- org.apache.jackrabbit.core.security.authorization.PrivilegeBits
-
public class PrivilegeBits extends Object
PrivilegeBits
-
-
Field Summary
Fields Modifier and Type Field Description static PrivilegeBits
EMPTY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(PrivilegeBits other)
Adds the other privilege bits to this instance.void
addDifference(PrivilegeBits a, PrivilegeBits b)
Subtracts theb
froma
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.
Ifthis
is included inother
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)
Returnstrue
if all privileges defined by the specifiedotherBits
are present in this instance.boolean
includesRead()
Returnstrue
if this instance includes the jcr:read privilege.boolean
isEmpty()
Returnstrue
if this privilege bits includes no privileges at all.boolean
isModifiable()
Returnstrue
if this privilege bits instance can be altered.String
toString()
PrivilegeBits
unmodifiable()
Returns an unmodifiable instance.
-
-
-
Field Detail
-
EMPTY
public static final PrivilegeBits EMPTY
-
-
Method Detail
-
getInstance
public static PrivilegeBits getInstance()
Creates a mutable instance of privilege bits.- Returns:
- a new instance of privilege bits.
-
getInstance
public static PrivilegeBits getInstance(PrivilegeBits base)
Creates a mutable instance of privilege bits.- Parameters:
base
-- Returns:
- a new instance of privilege bits.
-
isEmpty
public boolean isEmpty()
Returnstrue
if this privilege bits includes no privileges at all.- Returns:
true
if this privilege bits includes no privileges at all;false
otherwise.- See Also:
PrivilegeRegistry.NO_PRIVILEGE
-
unmodifiable
public PrivilegeBits unmodifiable()
Returns an unmodifiable instance.- Returns:
- an unmodifiable
PrivilegeBits
instance.
-
isModifiable
public boolean isModifiable()
Returnstrue
if this privilege bits instance can be altered.- Returns:
- true if this privilege bits instance can be altered.
-
includesRead
public boolean includesRead()
Returnstrue
if this instance includes the jcr:read privilege. Shortcut for callingincludes(PrivilegeBits)
where the other bits represented the jcr:read privilege.- Returns:
true
if this instance includes the jcr:read privilege;false
otherwise.
-
includes
public boolean includes(PrivilegeBits otherBits)
Returnstrue
if all privileges defined by the specifiedotherBits
are present in this instance.- Parameters:
otherBits
-- Returns:
true
if all privileges defined by the specifiedotherBits
are included in this instance;false
otherwise.
-
add
public void add(PrivilegeBits other)
Adds the other privilege bits to this instance.- Parameters:
other
- The other privilege bits to be added.- Throws:
UnsupportedOperationException
- if this instance is immutable.
-
diff
public void diff(PrivilegeBits other)
Subtracts the other PrivilegeBits from the this.
If the specified bits do not intersect with this, it isn't modified.
Ifthis
is included inother
empty
privilege bits is returned.- Parameters:
other
- The other privilege bits to be substracted from this instance.- Throws:
UnsupportedOperationException
- if this instance is immutable.
-
addDifference
public void addDifference(PrivilegeBits a, PrivilegeBits b)
Subtracts theb
froma
and adds the result (diff) to this instance.- Parameters:
a
- An instance of privilege bits.b
- An instance of privilege bits.- Throws:
UnsupportedOperationException
- if this instance is immutable.
-
-