Package org.forgerock.openig.util
Class StringUtil
java.lang.Object
org.forgerock.openig.util.StringUtil
Miscellaneous string utility methods.
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
Transform the input String value into a slug: a simpler adaptation that is compatible for usage inside an URI (without requiring URL encoding).static String
toSIAbbreviation
(TimeUnit timeUnit) Return the SI abbreviation from the given TimeUnit name.
-
Method Details
-
slug
Transform the input String value into a slug: a simpler adaptation that is compatible for usage inside an URI (without requiring URL encoding).Examples:
slug("A sentence with blanks, commas and extra punctuation ! ") .equals("a-sentence-with-blanks-commas-and-extra-punctuation"); slug("{ClientHandler}/heap/2").equals(clienthandler-heap-2);
- Parameters:
value
- value to be transformed- Returns:
- A slug version of the input
-
toSIAbbreviation
Return the SI abbreviation from the given TimeUnit name.- Parameters:
timeUnit
- The time unit to get the abbreviation from(for output usage for example).- Returns:
- the SI abbreviation from the given
TimeUnit
name.
-