Enum EscapingScheme

Object
Enum<EscapingScheme>
EscapingScheme
All Implemented Interfaces:
Serializable, Comparable<EscapingScheme>, Constable

public enum EscapingScheme extends Enum<EscapingScheme>
  • Enum Constant Details

    • ALLOW_UTF8

      public static final EscapingScheme ALLOW_UTF8
      NO_ESCAPING indicates that a name will not be escaped.
    • UNDERSCORE_ESCAPING

      public static final EscapingScheme UNDERSCORE_ESCAPING
      UNDERSCORE_ESCAPING replaces all legacy-invalid characters with underscores.
    • DOTS_ESCAPING

      public static final EscapingScheme DOTS_ESCAPING
      DOTS_ESCAPING is similar to UNDERSCORE_ESCAPING, except that dots are converted to `_dot_` and pre-existing underscores are converted to `__`.
    • VALUE_ENCODING_ESCAPING

      VALUE_ENCODING_ESCAPING prepends the name with `U__` and replaces all invalid characters with the Unicode value, surrounded by underscores. Single underscores are replaced with double underscores.
  • Field Details

    • DEFAULT

      public static final EscapingScheme DEFAULT
      Default escaping scheme for names when not specified.
  • Method Details

    • values

      public static EscapingScheme[] 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 EscapingScheme 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
    • getValue

      public final String getValue()
    • fromAcceptHeader

      public static EscapingScheme fromAcceptHeader(@Nullable String acceptHeader)
      fromAcceptHeader returns an EscapingScheme depending on the Accept header. Iff the header contains an escaping=allow-utf-8 term, it will select NO_ESCAPING. If a valid "escaping" term exists, that will be used. Otherwise, the global default will be returned.
    • toHeaderFormat