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 PrivilegeBitsEMPTY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(PrivilegeBits other)Adds the other privilege bits to this instance.voidaddDifference(PrivilegeBits a, PrivilegeBits b)Subtracts thebfromaand adds the result (diff) to this instance.voiddiff(PrivilegeBits other)Subtracts the other PrivilegeBits from the this.
If the specified bits do not intersect with this, it isn't modified.
Ifthisis included inotheremptyprivilege bits is returned.booleanequals(Object o)static PrivilegeBitsgetInstance()Creates a mutable instance of privilege bits.static PrivilegeBitsgetInstance(PrivilegeBits base)Creates a mutable instance of privilege bits.inthashCode()booleanincludes(PrivilegeBits otherBits)Returnstrueif all privileges defined by the specifiedotherBitsare present in this instance.booleanincludesRead()Returnstrueif this instance includes the jcr:read privilege.booleanisEmpty()Returnstrueif this privilege bits includes no privileges at all.booleanisModifiable()Returnstrueif this privilege bits instance can be altered.StringtoString()PrivilegeBitsunmodifiable()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()
Returnstrueif this privilege bits includes no privileges at all.- Returns:
trueif this privilege bits includes no privileges at all;falseotherwise.- See Also:
PrivilegeRegistry.NO_PRIVILEGE
-
unmodifiable
public PrivilegeBits unmodifiable()
Returns an unmodifiable instance.- Returns:
- an unmodifiable
PrivilegeBitsinstance.
-
isModifiable
public boolean isModifiable()
Returnstrueif this privilege bits instance can be altered.- Returns:
- true if this privilege bits instance can be altered.
-
includesRead
public boolean includesRead()
Returnstrueif this instance includes the jcr:read privilege. Shortcut for callingincludes(PrivilegeBits)where the other bits represented the jcr:read privilege.- Returns:
trueif this instance includes the jcr:read privilege;falseotherwise.
-
includes
public boolean includes(PrivilegeBits otherBits)
Returnstrueif all privileges defined by the specifiedotherBitsare present in this instance.- Parameters:
otherBits-- Returns:
trueif all privileges defined by the specifiedotherBitsare included in this instance;falseotherwise.
-
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.
Ifthisis included inotheremptyprivilege 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 thebfromaand 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.
-
-