public final class Normalizer extends Object
Constructor and Description |
---|
Normalizer() |
Modifier and Type | Method and Description |
---|---|
static <T> void |
deDuplicate(List<T> list)
De-duplicate an array list.
|
static String |
lineReturns(String str)
Normalize line returns
|
static <T> void |
lineReturnsMap(Map<T,String> map)
Cleans the map by trimming all of the values.
|
static <T> void |
removeEmpty(List<T> list)
Removes empty values from the list.
|
static <T,U> void |
removeEmpty(Map<T,U> map)
Removes keys whose value are null.
|
static String |
removeLineReturns(String str)
Remove line returns from the string
|
static <T extends Collection<String>> |
toLowerCase(Collection<String> collection,
java.util.function.Supplier<T> supplier)
Lowercase the string values of the collection using the provided collection reference.
|
static String |
toLowerCase(String str)
Lowercases the String in a null-safe manner.
|
static String |
trim(String str)
Trims the String in a null safe manner.
|
static <T> void |
trimMap(Map<T,String> map)
Cleans the map by trimming all of the values.
|
static String |
trimToNull(String str)
Trims the String in a null safe manner and if the String ends up being empty, then this returns null.
|
static java.time.ZonedDateTime |
truncateToMilliseconds(java.time.ZonedDateTime time)
Truncate the provided time to milliseconds.
|
public static <T> void deDuplicate(List<T> list)
T
- the type of the list.list
- the list to de-duplicatepublic static String lineReturns(String str)
str
- The String to normalizepublic static <T> void lineReturnsMap(Map<T,String> map)
T
- the type of map keymap
- The map to clean.public static <T> void removeEmpty(List<T> list)
T
- the type of list.list
- The list.public static <T,U> void removeEmpty(Map<T,U> map)
T
- the type of map keyU
- the type of map valuemap
- The map.public static String removeLineReturns(String str)
str
- the string to remove line returnspublic static <T extends Collection<String>> void toLowerCase(Collection<String> collection, java.util.function.Supplier<T> supplier)
T
- the type of collectioncollection
- the collectionsupplier
- a collections supplierpublic static String toLowerCase(String str)
str
- The String to lowercase.public static String trim(String str)
str
- The String to trim.public static <T> void trimMap(Map<T,String> map)
T
- the type of map keymap
- The map to clean.public static String trimToNull(String str)
str
- The String to trim.public static java.time.ZonedDateTime truncateToMilliseconds(java.time.ZonedDateTime time)
time
- the timeCopyright © 2021. All rights reserved.