public final class ReflectionUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static Class<?>[] |
getInstantiableCollectionTypes() |
static Type |
getLowerBoundOfSingleTypeParameter(Type type)
Resolves the
Type of the lower bound of a single type argument of a
ParameterizedType. |
static <K,T extends Collection<K>> |
instantiateCollectionType(Class<T> collectionType)
Creates an instance with a default capacity.
|
static <K,T extends Collection<K>> |
instantiateCollectionType(Class<T> collectionType,
int length)
Provides an implementation instance for the desired collection type.
|
static boolean |
isInstantiableCollectionType(Class<?> type) |
public static Type getLowerBoundOfSingleTypeParameter(Type type)
Type of the lower bound of a single type argument of a
ParameterizedType.
private List<MyModel> myModel -> MyModel. private Optional<MyModel> myModel -> MyModel.
type - must not be null.public static <K,T extends Collection<K>> Collection<K> instantiateCollectionType(Class<T> collectionType, int length)
List, a suitable list implementation is instantiated.collectionType - must not be null.null. Throws an IllegalStateException
if the collection type is not supported.public static boolean isInstantiableCollectionType(Class<?> type)
type - must not be null.instantiateCollectionType(Class).public static Class<?>[] getInstantiableCollectionTypes()
assignable from in order to be
instantiable.public static <K,T extends Collection<K>> Collection<K> instantiateCollectionType(Class<T> collectionType)
Copyright © 2014–2015. All rights reserved.