|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.elasticsearch.common.inject.util.Types
public final class Types
Static methods for working with types.
Method Summary | |
---|---|
static java.lang.reflect.GenericArrayType |
arrayOf(java.lang.reflect.Type componentType)
Returns an array type whose elements are all instances of componentType . |
static java.lang.reflect.ParameterizedType |
listOf(java.lang.reflect.Type elementType)
Returns a type modelling a List whose elements are of type
elementType . |
static java.lang.reflect.ParameterizedType |
mapOf(java.lang.reflect.Type keyType,
java.lang.reflect.Type valueType)
Returns a type modelling a Map whose keys are of type
keyType and whose values are of type valueType . |
static java.lang.reflect.ParameterizedType |
newParameterizedType(java.lang.reflect.Type rawType,
java.lang.reflect.Type... typeArguments)
Returns a new parameterized type, applying typeArguments to
rawType . |
static java.lang.reflect.ParameterizedType |
newParameterizedTypeWithOwner(java.lang.reflect.Type ownerType,
java.lang.reflect.Type rawType,
java.lang.reflect.Type... typeArguments)
Returns a new parameterized type, applying typeArguments to
rawType and enclosed by ownerType . |
static java.lang.reflect.ParameterizedType |
providerOf(java.lang.reflect.Type providedType)
Returns a type modelling a Provider that provides elements of type
elementType . |
static java.lang.reflect.ParameterizedType |
setOf(java.lang.reflect.Type elementType)
Returns a type modelling a Set whose elements are of type
elementType . |
static java.lang.reflect.WildcardType |
subtypeOf(java.lang.reflect.Type bound)
Returns a type that represents an unknown type that extends bound . |
static java.lang.reflect.WildcardType |
supertypeOf(java.lang.reflect.Type bound)
Returns a type that represents an unknown supertype of bound . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static java.lang.reflect.ParameterizedType newParameterizedType(java.lang.reflect.Type rawType, java.lang.reflect.Type... typeArguments)
typeArguments
to
rawType
. The returned type does not have an owner type.
serializable
parameterized type.public static java.lang.reflect.ParameterizedType newParameterizedTypeWithOwner(java.lang.reflect.Type ownerType, java.lang.reflect.Type rawType, java.lang.reflect.Type... typeArguments)
typeArguments
to
rawType
and enclosed by ownerType
.
serializable
parameterized type.public static java.lang.reflect.GenericArrayType arrayOf(java.lang.reflect.Type componentType)
componentType
.
serializable
generic array type.public static java.lang.reflect.WildcardType subtypeOf(java.lang.reflect.Type bound)
bound
.
For example, if bound
is CharSequence.class
, this returns
? extends CharSequence
. If bound
is Object.class
,
this returns ?
, which is shorthand for ? extends Object
.
public static java.lang.reflect.WildcardType supertypeOf(java.lang.reflect.Type bound)
bound
. For
example, if bound
is String.class
, this returns ?
super String
.
public static java.lang.reflect.ParameterizedType listOf(java.lang.reflect.Type elementType)
List
whose elements are of type
elementType
.
serializable
parameterized type.public static java.lang.reflect.ParameterizedType setOf(java.lang.reflect.Type elementType)
Set
whose elements are of type
elementType
.
serializable
parameterized type.public static java.lang.reflect.ParameterizedType mapOf(java.lang.reflect.Type keyType, java.lang.reflect.Type valueType)
Map
whose keys are of type
keyType
and whose values are of type valueType
.
serializable
parameterized type.public static java.lang.reflect.ParameterizedType providerOf(java.lang.reflect.Type providedType)
Provider
that provides elements of type
elementType
.
serializable
parameterized type.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |