Class MoreTypes
java.lang.Object
org.elasticsearch.common.inject.internal.MoreTypes
Static methods for working with types that we aren't publishing in the
public
Types
API.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
static class
We cannot serialize the built-in Java member classes, which prevents us from using Members in our exception types.static class
static class
The WildcardType interface supports multiple upper bounds and multiple lower bounds. -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic Type
canonicalize(Type type)
Returns a type that is functionally equal but not necessarily equal according toObject.equals()
.static boolean
Returns true ifa
andb
are equal.static Type
getGenericSupertype(Type type, Class<?> rawType, Class<?> toResolve)
Returns the generic supertype forsupertype
.static Class<?>
getRawType(Type type)
static int
Returns the hashCode oftype
.static <T> TypeLiteral<T>
makeKeySafe(TypeLiteral<T> type)
Returns an equivalent type that's safe for use in a key.static String
memberType(Member member)
ReturnsField.class
,Method.class
orConstructor.class
.static Type
resolveTypeVariable(Type type, Class<?> rawType, TypeVariable unknown)
static String
Formats a member as concise string, such asjava.util.ArrayList.size
,java.util.ArrayList<init>()
orjava.util.List.remove()
.static String
-
Field Details
-
EMPTY_TYPE_ARRAY
-
-
Method Details
-
makeKeySafe
Returns an equivalent type that's safe for use in a key. The returned type will be free of primitive types. Type literals of primitives will return the corresponding wrapper types.- Throws:
ConfigurationException
- iftype
contains a type variable
-
canonicalize
Returns a type that is functionally equal but not necessarily equal according toObject.equals()
. -
getRawType
-
equals
Returns true ifa
andb
are equal. -
hashCode
Returns the hashCode oftype
. -
toString
-
memberType
ReturnsField.class
,Method.class
orConstructor.class
. -
toString
Formats a member as concise string, such asjava.util.ArrayList.size
,java.util.ArrayList<init>()
orjava.util.List.remove()
. -
memberKey
-
getGenericSupertype
Returns the generic supertype forsupertype
. For example, given a classIntegerSet
, the result for when supertype isSet.class
isSet<Integer>
and the result when the supertype isCollection.class
isCollection<Integer>
. -
resolveTypeVariable
-