Enum EnumRight
- java.lang.Object
-
- java.lang.Enum<EnumRight>
-
- org.opends.server.authorization.dseecompat.EnumRight
-
- All Implemented Interfaces:
Serializable
,Comparable<EnumRight>
public enum EnumRight extends Enum<EnumRight>
This class provides an enumeration of the allowed rights.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description ADD
This enumeration is returned when the result of the right is "add".ALL
This enumeration is returned when the result of the right is "all".COMPARE
This enumeration is returned when the result of the right is "compare".DELETE
This enumeration is returned when the result of the right is "delete".EXPORT
This enumeration is returned when the result of the right is "export".IMPORT
This enumeration is returned when the result of the right is "import".PROXY
This enumeration is returned when the result of the right is "proxy".READ
This enumeration is returned when the result of the right is "read".SEARCH
This enumeration is returned when the result of the right is "search".SELFWRITE
This enumeration is returned when the result of the right is "selfwrite".WRITE
This enumeration is returned when the result of the right is "write".
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static EnumRight
decode(String right)
Creates an enumeration of the right name.static Set<EnumRight>
getEnumRight(int rightsMask)
Return the EnumRight corresponding to the provided rightsMask.static int
getMask(EnumRight right)
Returns bit mask associated with the specified right.String
getRight()
Returns the string representation of the right.static boolean
hasRights(int rightsMask, int rights)
Checks if the provided rights mask has the specified rights.boolean
isRight(String right)
Checks if the enumeration is equal to the right name.static EnumRight
valueOf(String name)
Returns the enum constant of this type with the specified name.static EnumRight[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
READ
public static final EnumRight READ
This enumeration is returned when the result of the right is "read".- See Also:
Aci.ACI_READ
-
WRITE
public static final EnumRight WRITE
This enumeration is returned when the result of the right is "write".- See Also:
Aci.ACI_WRITE
-
ADD
public static final EnumRight ADD
This enumeration is returned when the result of the right is "add".- See Also:
Aci.ACI_ADD
-
DELETE
public static final EnumRight DELETE
This enumeration is returned when the result of the right is "delete".- See Also:
Aci.ACI_DELETE
-
SEARCH
public static final EnumRight SEARCH
This enumeration is returned when the result of the right is "search".- See Also:
Aci.ACI_SEARCH
-
COMPARE
public static final EnumRight COMPARE
This enumeration is returned when the result of the right is "compare".- See Also:
Aci.ACI_COMPARE
-
SELFWRITE
public static final EnumRight SELFWRITE
This enumeration is returned when the result of the right is "selfwrite".- See Also:
Aci.ACI_SELF
-
PROXY
public static final EnumRight PROXY
This enumeration is returned when the result of the right is "proxy".- See Also:
Aci.ACI_PROXY
-
IMPORT
public static final EnumRight IMPORT
This enumeration is returned when the result of the right is "import".- See Also:
Aci.ACI_IMPORT
-
EXPORT
public static final EnumRight EXPORT
This enumeration is returned when the result of the right is "export".- See Also:
Aci.ACI_EXPORT
-
ALL
public static final EnumRight ALL
This enumeration is returned when the result of the right is "all".- See Also:
Aci.ACI_ALL
-
-
Method Detail
-
values
public static EnumRight[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (EnumRight c : EnumRight.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static EnumRight valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getRight
public String getRight()
Returns the string representation of the right.- Returns:
- the string representation of the right
-
isRight
public boolean isRight(String right)
Checks if the enumeration is equal to the right name.- Parameters:
right
- The name of the right to check.- Returns:
- True if the right is equal to the enumeration's.
-
decode
public static EnumRight decode(String right)
Creates an enumeration of the right name.- Parameters:
right
- The name of the right.- Returns:
- An enumeration of the right or null if the name is invalid.
-
getMask
public static int getMask(EnumRight right)
Returns bit mask associated with the specified right.- Parameters:
right
- The right enumeration to return the mask for.- Returns:
- The bit mask associated with the right.
-
getEnumRight
public static Set<EnumRight> getEnumRight(int rightsMask)
Return the EnumRight corresponding to the provided rightsMask.- Parameters:
rightsMask
- the rights mask for which to return the corresponding EnumRight- Returns:
- EnumRight corresponding to the provided rightsMask.
-
hasRights
public static boolean hasRights(int rightsMask, int rights)
Checks if the provided rights mask has the specified rights.- Parameters:
rightsMask
- The rights mask to look into.rights
- The rights to check for.- Returns:
- true if the rights mask has the specified rights, false otherwise.
-
-