Package org.apache.rat.utils
Class CasedString
java.lang.Object
org.apache.rat.utils.CasedString
Handles converting from one string case to another (e.g. camel case to snake case).
- Since:
- 0.17
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
An enumeration of supported string cases. -
Constructor Summary
ConstructorsConstructorDescriptionCasedString
(CasedString.StringCase stringCase, String string) A representation of a cased string and the identified case of that string. -
Method Summary
Modifier and TypeMethodDescriptionString[]
Returns an array of each of the segments in this CasedString.toCase
(CasedString.StringCase stringCase) Converts this cased string into aString
of another format.toString()
Returns the string representation provided in the constructor.
-
Constructor Details
-
CasedString
A representation of a cased string and the identified case of that string.- Parameters:
stringCase
- TheStringCase
that thestring
argument is in.string
- The string.
-
-
Method Details
-
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
Converts this cased string into aString
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
Returns the string representation provided in the constructor.
-