public class GUtil extends Object
| Constructor and Description |
|---|
GUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Map |
addMaps(Map map1,
Map map2) |
static <V,T extends Collection<? super V>> |
addToCollection(T dest,
Iterable<? extends V>... srcs) |
static void |
addToMap(Map<String,String> dest,
Map<?,?> src) |
static Comparator<String> |
caseInsensitive() |
static Collection |
collectionize(Object input)
Flattens input collections (including arrays *but* not maps).
|
static <T> T |
elvis(T object,
T defaultValue) |
static List |
flatten(Collection elements) |
static List |
flatten(Collection elements,
boolean flattenMapsAndArrays) |
static <T extends Collection> |
flatten(Collection elements,
T addTo) |
static <T extends Collection> |
flatten(Collection elements,
T addTo,
boolean flattenMapsAndArrays) |
static <T extends Collection> |
flatten(Collection elements,
T addTo,
boolean flattenMaps,
boolean flattenArrays) |
static <T extends Collection> |
flatten(Object[] elements,
T addTo) |
static <T extends Collection> |
flatten(Object[] elements,
T addTo,
boolean flattenMaps) |
static <T extends Collection> |
flattenElements(Object... elements) |
static boolean |
isTrue(Object object) |
static String |
join(Collection self,
String separator) |
static String |
join(Object[] self,
String separator) |
static <T> Comparator<T> |
last(Comparator<? super T> comparator,
T lastValue) |
static Properties |
loadProperties(File propertyFile) |
static Properties |
loadProperties(InputStream inputStream) |
static Properties |
loadProperties(URL url) |
static Map |
map(Object... objects) |
static List<String> |
prefix(String prefix,
Collection<String> strings) |
static void |
saveProperties(Properties properties,
File propertyFile) |
static byte[] |
serialize(Object object) |
static String |
toCamelCase(CharSequence string)
Converts an arbitrary string to a camel-case string which can be used in a Java identifier.
|
static String |
toConstant(CharSequence string)
Converts an arbitrary string to upper case identifier with words separated by _.
|
static String |
toString(Iterable<?> names) |
static String |
toWords(CharSequence string)
Converts an arbitrary string to space-separated words.
|
static String |
toWords(CharSequence string,
char separator) |
public static <T extends Collection> T flatten(Object[] elements, T addTo, boolean flattenMaps)
public static <T extends Collection> T flatten(Object[] elements, T addTo)
public static <T extends Collection> T flatten(Collection elements, T addTo)
public static <T extends Collection> T flattenElements(Object... elements)
public static <T extends Collection> T flatten(Collection elements, T addTo, boolean flattenMapsAndArrays)
public static <T extends Collection> T flatten(Collection elements, T addTo, boolean flattenMaps, boolean flattenArrays)
public static Collection collectionize(Object input)
input - any objectpublic static List flatten(Collection elements, boolean flattenMapsAndArrays)
public static List flatten(Collection elements)
public static String join(Collection self, String separator)
public static List<String> prefix(String prefix, Collection<String> strings)
public static boolean isTrue(Object object)
public static <T> T elvis(T object,
T defaultValue)
public static <V,T extends Collection<? super V>> T addToCollection(T dest, Iterable<? extends V>... srcs)
public static Comparator<String> caseInsensitive()
public static Properties loadProperties(File propertyFile)
public static Properties loadProperties(URL url)
public static Properties loadProperties(InputStream inputStream)
public static void saveProperties(Properties properties, File propertyFile)
public static String toCamelCase(CharSequence string)
public static String toConstant(CharSequence string)
public static String toWords(CharSequence string)
public static String toWords(CharSequence string, char separator)
public static byte[] serialize(Object object)
public static <T> Comparator<T> last(Comparator<? super T> comparator, T lastValue)
Copyright © 2013. All rights reserved