Package org.apache.kafka.common.acl
Enum AclPermissionType
- java.lang.Object
-
- java.lang.Enum<AclPermissionType>
-
- org.apache.kafka.common.acl.AclPermissionType
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Comparable<AclPermissionType>
@Evolving public enum AclPermissionType extends java.lang.Enum<AclPermissionType>
Represents whether an ACL grants or denies permissions. The API for this class is still evolving and we may break compatibility in minor releases, if necessary.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description byte
code()
Return the code of this permission type.static AclPermissionType
fromCode(byte code)
Return the AclPermissionType with the provided code or `AclPermissionType.UNKNOWN` if one cannot be found.static AclPermissionType
fromString(java.lang.String str)
Parse the given string as an ACL permission.boolean
isUnknown()
Return true if this permission type is UNKNOWN.static AclPermissionType
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.static AclPermissionType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
UNKNOWN
public static final AclPermissionType UNKNOWN
Represents any AclPermissionType which this client cannot understand, perhaps because this client is too old.
-
ANY
public static final AclPermissionType ANY
In a filter, matches any AclPermissionType.
-
DENY
public static final AclPermissionType DENY
Disallows access.
-
ALLOW
public static final AclPermissionType ALLOW
Grants access.
-
-
Method Detail
-
values
public static AclPermissionType[] 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 (AclPermissionType c : AclPermissionType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static AclPermissionType valueOf(java.lang.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:
java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is null
-
fromString
public static AclPermissionType fromString(java.lang.String str)
Parse the given string as an ACL permission.- Parameters:
str
- The string to parse.- Returns:
- The AclPermissionType, or UNKNOWN if the string could not be matched.
-
fromCode
public static AclPermissionType fromCode(byte code)
Return the AclPermissionType with the provided code or `AclPermissionType.UNKNOWN` if one cannot be found.
-
code
public byte code()
Return the code of this permission type.
-
isUnknown
public boolean isUnknown()
Return true if this permission type is UNKNOWN.
-
-