org.enhydra.zeus.util
Class CapitalizationUtils


public class CapitalizationUtils

Capitalization is a Zeus utility class that provides for converting lowercase letters to uppercase ones, uppercase ones to lowercase ones, and more generally, converting Java Strings from an unknown format to initial caps (where only the first letter is capitalized), making a suitable class or variable name.

Author:
Brett McLaughlin
Version: 1.0

Method Summary
 static StringallLower(String original)
           This will take a String with unknown capitalization, and convert all the letters to lowercase letters.
 static StringallUpper(String original)
           This will take a String with unknown capitalization, and convert all the letters to uppercase letters.
 static StringinitialLower(String original)
           This will take a String with unknown capitalization, and convert the first letter to a lowercase letter, while leaving all other letters the same.
 static StringinitialUpper(String original)
           This will take a String with unknown capitalization, and convert the first letter to a capital letter, while leaving all other letters the same.
 static StringjustInitialUpper(String original)
           This will take a String with unknown capitalization, and convert the first letter to a capital letter, while converting all other letters to lowercase.

Method Detail

allLower

public static String allLower(String original)

This will take a String with unknown capitalization, and convert all the letters to lowercase letters. Note that if you want just the first letter converted to lowercase, then initialLower(java.lang.String) should be used.

And for all you geniuses out there, yes, I know that toLowerCase() can be used directly; but placing the code within this method allows this class to be uniformly used for all capitalization purposes.

Parameters:
original - String to convert.
Returns: String - the converted String.

allUpper

public static String allUpper(String original)

This will take a String with unknown capitalization, and convert all the letters to uppercase letters. Note that if you want just the first letter converted to lowercase, then initialUpper(java.lang.String) should be used.

And for all you geniuses out there, yes, I know that toUpperCase() can be used directly; but placing the code within this method allows this class to be uniformly used for all capitalization purposes.

Parameters:
original - String to convert.
Returns: String - the converted String.

initialLower

public static String initialLower(String original)

This will take a String with unknown capitalization, and convert the first letter to a lowercase letter, while leaving all other letters the same. Note that if you want the rest of the letters converted to lowercase, then allLower(java.lang.String) should be used.

Parameters:
original - String to convert.
Returns: String - the converted String.

initialUpper

public static String initialUpper(String original)

This will take a String with unknown capitalization, and convert the first letter to a capital letter, while leaving all other letters the same. Note that if you want the rest of the letters converted to lowercase, then justInitialUpper(java.lang.String) should be used.

Parameters:
original - String to convert.
Returns: String - the converted String.

justInitialUpper

public static String justInitialUpper(String original)

This will take a String with unknown capitalization, and convert the first letter to a capital letter, while converting all other letters to lowercase. Note that if you want the rest of the letters left alone, then initialUpper(java.lang.String) should be used.

Parameters:
original - String to convert.
Returns: String - the converted String.