Class CasedString

java.lang.Object
org.apache.rat.utils.CasedString

public class CasedString extends Object
Handles converting from one string case to another (e.g. camel case to snake case).
Since:
0.17
  • Constructor Details

    • CasedString

      public CasedString(CasedString.StringCase stringCase, String string)
      A representation of a cased string and the identified case of that string.
      Parameters:
      stringCase - The StringCase that the string argument is in.
      string - The string.
  • Method Details

    • getSegments

      public String[] getSegments()
      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.
    • toCase

      public String toCase(CasedString.StringCase stringCase)
      Converts this cased string into a String of another format. The upper/lower case of the characters within the string are not modified.
      Parameters:
      stringCase - The format to convert to.
      Returns:
      the String current string represented in the new format.
    • toString

      public String toString()
      Returns the string representation provided in the constructor.
      Overrides:
      toString in class Object
      Returns:
      the string representation.