Class FormatUtils

java.lang.Object
com.avoka.fc.core.util.FormatUtils

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

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    Return a formatted version of a HTTP URL.
    static String
    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
    static String
    Get current date string format as "yyyy-MM-dd".

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • FormatUtils

      public FormatUtils()
  • Method Details

    • 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