Package org.apache.guacamole.properties
Enum CaseSensitivity
- All Implemented Interfaces:
Serializable
,Comparable<CaseSensitivity>
,java.lang.constant.Constable
An enum that supports configuring various user and group case sensitivity
settings.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionCase sensitivity disabled for both usernames and group names.Case sensitivity enabled for both usernames and group names.Case sensitivity disabled for usernames but enabled for group names.Case sensitivity enabled for usernames but disabled for group names. -
Method Summary
Modifier and TypeMethodDescriptionstatic String
canonicalize
(String identifier, boolean caseSensitive) Converts the given identifier into a canonical form which ensures simple verbatim string comparisons are consistent with the case sensitivity setting.canonicalizeGroupName
(String groupName) Canonicalizes the given group name according to whether group names are case-sensitive under this case sensitivity setting.canonicalizeUsername
(String username) Canonicalizes the given username according to whether usernames are case-sensitive under this case sensitivity setting.boolean
Return "true" if case sensitivity is enabled group names, otherwise "false".boolean
Return "true" if case sensitivity is enabled for usernames, otherwise "false".static CaseSensitivity
Returns the enum constant of this type with the specified name.static CaseSensitivity[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
Enum Constant Details
-
ENABLED
Case sensitivity enabled for both usernames and group names. -
USERS
Case sensitivity enabled for usernames but disabled for group names. -
GROUPS
Case sensitivity disabled for usernames but enabled for group names. -
DISABLED
Case sensitivity disabled for both usernames and group names.
-
-
Method Details
-
values
Returns an array containing the constants of this enum type, in the order they are declared.- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
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
-
caseSensitiveUsernames
public boolean caseSensitiveUsernames()Return "true" if case sensitivity is enabled for usernames, otherwise "false".- Returns:
- "true" if case sensitivity is enabled for usernames, otherwise "false".
-
caseSensitiveGroupNames
public boolean caseSensitiveGroupNames()Return "true" if case sensitivity is enabled group names, otherwise "false".- Returns:
- "true" if case sensitivity is enabled for group names, otherwise "false".
-
canonicalize
Converts the given identifier into a canonical form which ensures simple verbatim string comparisons are consistent with the case sensitivity setting. If case-sensitive, identifiers are simply returned without modification. If case-insensitive, identifiers are converted to lowercase with respect to theLocale.ROOT
locale.- Parameters:
identifier
- The identifier to convert into a canonical form.caseSensitive
- Whether the given identifier is case-sensitive.- Returns:
- The given identifier, transformed as necessary to ensure that verbatim string comparisons are consistent with the case sensitivity setting.
-
canonicalizeUsername
Canonicalizes the given username according to whether usernames are case-sensitive under this case sensitivity setting. This function is equivalent to manually invokingcanonicalize(java.lang.String, boolean)
with the value ofcaseSensitiveUsernames()
.- Parameters:
username
- The username to canonicalize.- Returns:
- The given username, transformed as necessary to ensure that verbatim string comparisons are consistent with the case sensitivity setting for usernames.
-
canonicalizeGroupName
Canonicalizes the given group name according to whether group names are case-sensitive under this case sensitivity setting. This function is equivalent to manually invokingcanonicalize(java.lang.String, boolean)
with the value ofcaseSensitiveGroupNames()
.- Parameters:
groupName
- The group name to canonicalize.- Returns:
- The given group name, transformed as necessary to ensure that verbatim string comparisons are consistent with the case sensitivity setting for group names.
-