|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.univocity.api.common.Utils
public class Utils
A central place for utility methods.
| Constructor Summary | |
|---|---|
Utils()
|
|
| Method Summary | ||
|---|---|---|
static
|
getEntryCaseInsensitive(Map<String,V> map,
String key)
Returns the Map.Entry stored in a map by searching for a given String
key case-insensitively. |
|
static
|
getValueCaseInsensitive(Map<String,V> map,
String key)
Returns the value stored in a map by searching for a given String
key case-insensitively. |
|
static String |
join(Iterable<?> values,
String separator)
Joins the String representation of all non-null values in a given
collection into a String, with a given separator between each value. |
|
static
|
joinValues(Map<K,V> map,
String separator)
Joins each collection of values in a given Map into their String
representation, with a given separator between each value. |
|
static
|
putValueCaseInsensitive(Map<String,List<V>> map,
String key,
V value,
boolean add)
Adds a given value into a list of values of a map, where the key should be handled case-insensitively. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Utils()
| Method Detail |
|---|
public static final String join(Iterable<?> values,
String separator)
String representation of all non-null values in a given
collection into a String, with a given separator between each value.
values - the values to be joined. Nulls are skipped.separator - the separator to use between each value
public static final <K,V extends Iterable> Map<K,String> joinValues(Map<K,V> map,
String separator)
Map into their String
representation, with a given separator between each value.
K - the type of the key used in the given mapV - the type of the collection of values associated with each key of the mapmap - a map containing collections as its valuesseparator - the separator to be used between each value
public static final <V> Map.Entry<String,V> getEntryCaseInsensitive(Map<String,V> map,
String key)
Map.Entry stored in a map by searching for a given String
key case-insensitively.
V - the type of values stored in the mapmap - the map to searchkey - the key to look for
Map.Entry associated with the given key, or null if not found.
public static final <V> V getValueCaseInsensitive(Map<String,V> map,
String key)
String
key case-insensitively.
V - the type of values stored in the mapmap - the map to searchkey - the key to look for
null if not found.
public static final <V> void putValueCaseInsensitive(Map<String,List<V>> map,
String key,
V value,
boolean add)
V - the type of the values stored in the map.map - the map into which the value will be addedkey - the key to look forvalue - the value to addadd - a flag indicating whether the value should be added to the list of existing values, or if
the list should be replaced by a new one containing only the given value.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||