public final class BeanPropertyUtils extends Object
Constructor and Description |
---|
BeanPropertyUtils() |
Modifier and Type | Method and Description |
---|---|
static <T> List<T> |
addToList(List<T> l,
Collection<T> val)
Copies the specified values into an existing list.
|
static <T> List<T> |
addToList(List<T> appendTo,
Object[] values,
Class<T> type,
Type... args)
Adds a set of values to an existing list.
|
static <K,V> Map<K,V> |
addToMap(Map<K,V> m,
K key,
V value)
Adds a single entry into an existing map.
|
static <K,V> Map<K,V> |
addToMap(Map<K,V> m,
Map<K,V> val)
Copies the specified values into an existing map.
|
static <K,V> Map<K,V> |
addToMap(Map<K,V> appendTo,
Object[] values,
Class<K> keyType,
Class<V> valueType,
Type... valueTypeArgs)
Adds a set of values to an existing map.
|
static <T> List<T> |
newList(Collection<T> val)
Creates a new list from the specified collection.
|
static <K,V> Map<K,V> |
newMap(Map<K,V> val)
Creates a new map from the specified map.
|
static Boolean |
toBoolean(Object o)
Converts a value to a Boolean.
|
static Integer |
toInteger(Object o)
Converts a value to an Integer.
|
static Number |
toNumber(Object o)
Converts a value to a Number.
|
static String |
toStringVal(Object o)
Converts a value to a String.
|
static <T> T |
toType(Object o,
Class<T> type,
Type... args)
Converts an object to the specified type.
|
static URI |
toURI(Object o)
Converts a value to a URI.
|
public BeanPropertyUtils()
public static String toStringVal(Object o)
o
- The value to convert.public static Boolean toBoolean(Object o)
o
- The value to convert.public static Number toNumber(Object o)
o
- The value to convert.public static Integer toInteger(Object o)
o
- The value to convert.public static URI toURI(Object o)
o
- The value to convert.public static <T> List<T> addToList(List<T> appendTo, Object[] values, Class<T> type, Type... args)
appendTo
- The list to append to.
ArrayList
will be created.values
- The values to add.type
- The data type of the elements.args
- The generic type arguments of the data type.public static <K,V> Map<K,V> addToMap(Map<K,V> appendTo, Object[] values, Class<K> keyType, Class<V> valueType, Type... valueTypeArgs)
appendTo
- The map to append to.
LinkedHashMap
will be created.values
- The values to add.keyType
- The data type of the keys.valueType
- The data type of the values.valueTypeArgs
- The generic type arguments of the data type of the values.public static <T> T toType(Object o, Class<T> type, Type... args)
o
- The object to convert.type
- The type to covert to.args
- The type arguments for types of map or collection.public static <T> List<T> newList(Collection<T> val)
val
- The value to copy from.ArrayList
, or public static <T> List<T> addToList(List<T> l, Collection<T> val)
l
- The list to add to.
ArrayList
will be created.val
- The values to add.public static <K,V> Map<K,V> newMap(Map<K,V> val)
val
- The value to copy from.LinkedHashMap
, or public static <K,V> Map<K,V> addToMap(Map<K,V> m, Map<K,V> val)
m
- The map to add to.
LinkedHashMap
will be created.val
- The values to add.public static <K,V> Map<K,V> addToMap(Map<K,V> m, K key, V value)
m
- The map to add to.
LinkedHashMap
will be created.key
- The entry key.value
- The entry value.Copyright © 2018 Apache. All rights reserved.