Enum CasedString.StringCase

java.lang.Object
java.lang.Enum<CasedString.StringCase>
org.apache.rat.utils.CasedString.StringCase
All Implemented Interfaces:
Serializable, Comparable<CasedString.StringCase>
Enclosing class:
CasedString

public static enum CasedString.StringCase extends Enum<CasedString.StringCase>
An enumeration of supported string cases. These cases tag strings as having a specific format.
  • Enum Constant Details

    • CAMEL

      public static final CasedString.StringCase CAMEL
      Camel case tags strings like 'CamelCase' or 'camelCase'. This conversion forces the first character to lower case. If specific capitalization rules are required use WordUtils.capitalize(String) to set the first character of the string.
    • SNAKE

      public static final CasedString.StringCase SNAKE
      Snake case tags strings like 'Snake_Case'. This conversion does not change the capitalization of any characters in the string. If specific capitalization is required use String.toUpperCase(), String.toLowerCase(), or the commons-text methods WordUtils.capitalize(String), or WordUtils.uncapitalize(String) as required.
    • KEBAB

      public static final CasedString.StringCase KEBAB
      Kebab case tags strings like 'kebab-case'. This conversion does not change the capitalization of any characters in the string. If specific capitalization is required use String.toUpperCase(), String.toLowerCase(), * or the commons-text methods WordUtils.capitalize(String), or WordUtils.uncapitalize(String) as required.
    • PHRASE

      public static final CasedString.StringCase PHRASE
      Phrase case tags phrases of words like 'phrase case'. This conversion does not change the capitalization of any characters in the string. If specific capitalization is required use String.toUpperCase(), String.toLowerCase(), * or the commons-text methods WordUtils.capitalize(String), or WordUtils.uncapitalize(String) as required.
    • DOT

      public static final CasedString.StringCase DOT
      Dot case tags phrases of words like 'phrase.case'. This conversion does not change the capitalization of any characters in the string. If specific capitalization is required use String.toUpperCase(), String.toLowerCase(), * or the commons-text methods WordUtils.capitalize(String), or WordUtils.uncapitalize(String) as required.
  • Method Details

    • values

      public static CasedString.StringCase[] 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 CasedString.StringCase 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
    • assemble

      public String assemble(String[] segments)
      Creates a cased string from a collection of segments.
      Parameters:
      segments - the segments to create the CasedString from.
      Returns:
      a CasedString
    • getSegments

      public String[] getSegments(String string)
      Returns an array of each of the segments in this CasedString. Segments are defined as the strings between the separators in the CasedString. For the CAMEL case the segments are determined by the presence of a capital letter.
      Returns:
      the array of Strings that are segments of the cased string.