Class PrivilegeBits
- java.lang.Object
- 
- org.apache.jackrabbit.core.security.authorization.PrivilegeBits
 
- 
 public class PrivilegeBits extends Object PrivilegeBits
- 
- 
Field SummaryFields Modifier and Type Field Description static PrivilegeBitsEMPTY
 - 
Method SummaryAll 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- 
EMPTYpublic static final PrivilegeBits EMPTY 
 
- 
 - 
Method Detail- 
getInstancepublic static PrivilegeBits getInstance() Creates a mutable instance of privilege bits.- Returns:
- a new instance of privilege bits.
 
 - 
getInstancepublic static PrivilegeBits getInstance(PrivilegeBits base) Creates a mutable instance of privilege bits.- Parameters:
- base-
- Returns:
- a new instance of privilege bits.
 
 - 
isEmptypublic 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
 
 - 
unmodifiablepublic PrivilegeBits unmodifiable() Returns an unmodifiable instance.- Returns:
- an unmodifiable PrivilegeBitsinstance.
 
 - 
isModifiablepublic boolean isModifiable() Returnstrueif this privilege bits instance can be altered.- Returns:
- true if this privilege bits instance can be altered.
 
 - 
includesReadpublic 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.
 
 - 
includespublic boolean includes(PrivilegeBits otherBits) Returnstrueif all privileges defined by the specifiedotherBitsare present in this instance.- Parameters:
- otherBits-
- Returns:
- trueif all privileges defined by the specified- otherBitsare included in this instance;- falseotherwise.
 
 - 
addpublic 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.
 
 - 
diffpublic 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.
 
 - 
addDifferencepublic 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.
 
 
- 
 
-