Class FormatUtils


  • public class FormatUtils
    extends Object
    Provides utility methods around string formatting.
    • Constructor Detail

      • FormatUtils

        public FormatUtils()
    • Method Detail

      • formatHttpUrl

        public static String formatHttpUrl​(String url)
        Return a formatted version of a HTTP URL. The URL is prefixed with "http://" if no prefix is present and the URL is not null.
        Parameters:
        url - the URL to be formatted
        Returns:
        a formatted version of the URL
      • generateNormalizedString

        public static String generateNormalizedString​(String source)
        Generate a normalized version of a string according to the following rules: - the result string will contain only lower case letters, numbers and hyphens - letters in the original string will be converted to lower case - ampersand characters will be converted to the string 'and' - space and underscore characters will be converted to hyphens - after this conversion, multiple hyphens will be compacted to a single hyphen - all other non-alphanumeric characters will be omitted
        Parameters:
        source - the string to normalize
        Returns:
        a new normalized string
      • getExportDateString

        public static String getExportDateString()
        Get current date string format as "yyyy-MM-dd".
        Returns:
        current date string
        Since:
        5.1.0