Package com.avoka.fc.core.util
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 FormatUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
formatHttpUrl(String url)
Return a formatted version of a HTTP URL.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 omittedstatic String
getExportDateString()
Get current date string format as "yyyy-MM-dd".
-
-
-
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
-
-