public class Tools extends Object
| Constructor and Description |
|---|
Tools() |
| Modifier and Type | Method and Description |
|---|---|
static Map<String,String> |
asMap(Properties props)
Copy the properties state and returns it as a modifiable map.
|
static Properties |
asProperties(Map<String,String> map)
Copy the provided map and returns it as a modifiable properties object.
|
static boolean |
endsWithIgnoreCase(String s,
String end)
Returns true if the string s ends with the end string ignoring the case.
|
static TimeZone |
getTimeZone(String ID)
This method is similar to
TimeZone.getTimeZone(String) with less contention |
static Set<String> |
parseCommaList(String s)
Parse the provided list according to the comma separator.
|
static <E> Set<E> |
set(E... elements)
Instantiates a
HashSet object and fills it with the provided element array. |
public static <E> Set<E> set(E... elements) throws IllegalArgumentException
HashSet object and fills it with the provided element array.E - the element typeelements - the list of elements to addIllegalArgumentException - if the element array is nullpublic static Set<String> parseCommaList(String s) throws IllegalArgumentException
String.split(String) method with the ","
argument. Each chunk is then trimmed and if its length is not zero then it is
added to the returned set.s - the list to parseIllegalArgumentException - if the string argument is nullpublic static Properties asProperties(Map<String,String> map) throws IllegalArgumentException
map - the map to copyIllegalArgumentException - if the map argument is nullpublic static Map<String,String> asMap(Properties props) throws IllegalArgumentException
props - the properties object to copyIllegalArgumentException - if the props argument is nullpublic static boolean endsWithIgnoreCase(String s, String end) throws IllegalArgumentException
s - the string to testend - the string suffixIllegalArgumentException - if any string is nullpublic static TimeZone getTimeZone(String ID)
TimeZone.getTimeZone(String) with less contentionCopyright © 2021 eXo Platform SAS. All Rights Reserved.