Class Utility


  • public class Utility
    extends Object
    • Constructor Detail

      • Utility

        public Utility()
    • Method Detail

      • stripWhitespace

        public static String stripWhitespace​(String value)
      • stripNewLines

        public static String stripNewLines​(String value)
      • filterString

        public static String filterString​(String value)
      • trimString

        public static String trimString​(String value,
                                        int length)
      • stripOnlyWhitespaceAndNewLine

        public static String stripOnlyWhitespaceAndNewLine​(String value)
        Strips only newline characters and extra whitespaces.
        Parameters:
        value - A string value.
        Returns:
        The filtered value.
      • collapse

        public static String collapse​(String source)
        Method to remove extra spaces from the string specified by the string attributes. It returns the collapsed string without any additional spaces at the beginning of the string and '\r\n' characters. Example (orignal line): OBJECT = "THIS LINE IS BAD" (collapsed): OBJECT = "THIS LINE IS BAD"
      • itrim

        public static String itrim​(String source)
        Replace multiple whitespaces between words with single blank
      • ltrim

        public static String ltrim​(String source)
        Trim the string of any spaces on the left end (ie., leading spaces removed) Remove leading spaces for each line when there is multiple lines of string
      • rtrim

        public static String rtrim​(String source)
        Trim the string of any spaces on the right end (ie., trailing spaces removed)
      • isNull

        public static boolean isNull​(String value)
        Determines whether a value is null as defined by the PDS.
        Parameters:
        value - The value in question
        Returns:
        true if the value is null, false otherwise.
      • getDateTime

        public static String getDateTime()
        Get the current date time.
        Returns:
        A date time.
      • replaceChars

        public static String replaceChars​(String strToReplace)
      • valueExists

        public static boolean valueExists​(String value,
                                          List<String> lists)