public final class Objects extends Object
| Constructor and Description |
|---|
Objects() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
convertStringToClass(String theString,
Class<T> targetType)
Converts a string into the specified class type by assuming a new instance of the class can be constructed with a string
argument (e.g.
|
static Map<String,Object> |
getObjectFieldsAsMap(Object object)
Extracts all fields, including private fields, from the specified object and returns them in a
Map. |
public static <T> T convertStringToClass(String theString, Class<T> targetType) throws IllegalArgumentException
Boolean.Boolean(String), Double.Double(String), etc).theString - targetType - The type must have a constructor taking a single string argument to be used with this functionnull if the construction fails. NOTE: Classes
might accept an incorrect argument and return an object.IllegalArgumentException - If the string to convert is null or empty, or no target type specifiedCopyright © 2017. All rights reserved.