Enum CaseFormat

    • Enum Constant Detail


        public static final CaseFormat LOWER_HYPHEN
        Hyphenated variable naming convention, e.g., "lower-hyphen".

        public static final CaseFormat LOWER_CAMEL
        Java variable naming convention, e.g., "lowerCamel".

        public static final CaseFormat UPPER_CAMEL
        Java and C++ class naming convention, e.g., "UpperCamel".

        public static final CaseFormat UPPER_UNDERSCORE
        Java and C++ constant naming convention, e.g., "UPPER_UNDERSCORE".
    • Method Detail

      • values

        public static CaseFormat[] 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 (CaseFormat c : CaseFormat.values())
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static CaseFormat 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.)
        name - the name of the enum constant to be returned.
        the enum constant with the specified name
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null
      • to

        public final String to​(CaseFormat format,
                               String str)
        Converts the specified String str from this format to the specified format. A "best effort" approach is taken; if str does not conform to the assumed format, then the behavior of this method is undefined but we make a reasonable effort at converting anyway.