Package com.avoka.fc.core.util
Class FormatUtils
java.lang.Object
com.avoka.fc.core.util.FormatUtils
Provides utility methods around string formatting.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic 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
Get current date string format as "yyyy-MM-dd".
-
Constructor Details
-
FormatUtils
public FormatUtils()
-
-
Method Details
-
formatHttpUrl
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
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
Get current date string format as "yyyy-MM-dd".- Returns:
- current date string
- Since:
- 5.1.0
-