@InterfaceAudience.Public @InterfaceStability.Stable public final class WrapperUtils extends Object
| Constructor and Description |
|---|
WrapperUtils() |
| Modifier and Type | Method and Description |
|---|---|
static <T> Class<T> |
getClass(T type)
Gets the class of the specified type.
|
static <T> Class<T> |
getClassFromPrimitive(Class<T> type)
Gets the class of the specified type.
|
static <T> T |
to(Object value,
T defValue)
Converts the value to the specified object type provided and returns,
else returns the default value provided.
|
static <T> T |
to(String value,
Class<T> klass)
Converts the value to the specified object type provided and returns,
else returns the default value provided.
|
static <T> T |
to(String value,
T defValue)
Converts the value to the specified object type provided and returns,
else returns the default value provided.
|
public static <T> T to(Object value, T defValue)
T - the generic typevalue - the valuedefValue - the default valuepublic static <T> T to(String value, T defValue)
T - the generic typevalue - the valuedefValue - the default valuepublic static <T> T to(String value, Class<T> klass)
T - the generic typevalue - the valueklass - the klasspublic static <T> Class<T> getClass(T type)
T - the generic typetype - the typeCopyright © 2016 utils4j. All Rights Reserved.