Enum Class CaseFormat

java.lang.Object
java.lang.Enum<CaseFormat>
dev.getelements.elements.rt.annotation.CaseFormat
All Implemented Interfaces:
Serializable, Comparable<CaseFormat>, Constable

public enum CaseFormat extends Enum<CaseFormat>
Specifies case format translation. This should accommodate most, if not all languages. This relies on the underlying Guava library, but adds additional cases.
  • Enum Constant Details

    • NATURAL

      public static final CaseFormat NATURAL
      Indicates natural case, which means to use the underlying language's default format. When either case involves natural case, no conversion will take effect.
    • LOWER_HYPHEN

      public static final CaseFormat LOWER_HYPHEN
      See CaseFormat.LOWER_HYPHEN
    • LOWER_CAMEL

      public static final CaseFormat LOWER_CAMEL
      See CaseFormat.LOWER_CAMEL
    • UPPER_CAMEL

      public static final CaseFormat UPPER_CAMEL
      See CaseFormat.UPPER_CAMEL
    • LOWER_UNDERSCORE

      public static final CaseFormat LOWER_UNDERSCORE
      See CaseFormat.LOWER_UNDERSCORE
    • UPPER_UNDERSCORE

      public static final CaseFormat UPPER_UNDERSCORE
      See CaseFormat.UPPER_UNDERSCORE
  • Method Details

    • values

      public static CaseFormat[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static CaseFormat valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (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 class has no constant with the specified name
      NullPointerException - if the argument is null
    • to

      public final String to(CaseFormat other, String in)
      Converts this to the other case.
      Parameters:
      other - the other case
      in - the input stream
      Returns:
      the input string converted to the requested case.