Enum CaseSensitivity

java.lang.Object
java.lang.Enum<CaseSensitivity>
org.apache.guacamole.properties.CaseSensitivity
All Implemented Interfaces:
Serializable, Comparable<CaseSensitivity>, java.lang.constant.Constable

public enum CaseSensitivity extends Enum<CaseSensitivity>
An enum that supports configuring various user and group case sensitivity settings.
  • Enum Constant Details

    • ENABLED

      public static final CaseSensitivity ENABLED
      Case sensitivity enabled for both usernames and group names.
    • USERS

      public static final CaseSensitivity USERS
      Case sensitivity enabled for usernames but disabled for group names.
    • GROUPS

      public static final CaseSensitivity GROUPS
      Case sensitivity disabled for usernames but enabled for group names.
    • DISABLED

      public static final CaseSensitivity DISABLED
      Case sensitivity disabled for both usernames and group names.
  • Method Details

    • values

      public static CaseSensitivity[] 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

      public static CaseSensitivity 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 name
      NullPointerException - 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

      public static 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. If case-sensitive, identifiers are simply returned without modification. If case-insensitive, identifiers are converted to lowercase with respect to the Locale.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

      public String canonicalizeUsername(String username)
      Canonicalizes the given username according to whether usernames are case-sensitive under this case sensitivity setting. This function is equivalent to manually invoking canonicalize(java.lang.String, boolean) with the value of caseSensitiveUsernames().
      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

      public String canonicalizeGroupName(String groupName)
      Canonicalizes the given group name according to whether group names are case-sensitive under this case sensitivity setting. This function is equivalent to manually invoking canonicalize(java.lang.String, boolean) with the value of caseSensitiveGroupNames().
      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.