Class MoreTypes
org.elasticsearch.common.inject.internal.MoreTypes
public class MoreTypes
extends
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)
Returns a type that is functionally equal but not necessarily equal according to .static boolean
a, b)
Returns true ifa
andb
are equal.static
type, <?> rawType, <?> toResolve)
Returns the generic supertype forsupertype
.static <?>
type)
static int
type)
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
member)
static <? extends >
member)
ReturnsField.class
,Method.class
orConstructor.class
.static
type, <?> rawType, unknown)
static
member)
Formats a member as concise string, such asjava.util.ArrayList.size
,java.util.ArrayList<init>()
orjava.util.List.remove()
.static
type)
Methods inherited from class java.lang.
, , , , , , , , , ,
-
Field Details
-
EMPTY_TYPE_ARRAY
public static final [] 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
public static canonicalize( type)Returns a type that is functionally equal but not necessarily equal according to . -
getRawType
public static <?> getRawType( type) -
equals
public static boolean equals( a, b)Returns true ifa
andb
are equal. -
hashCode
public static int hashCode( type)Returns the hashCode oftype
. -
toString
public static toString( type) -
memberType
public static <? extends > memberType( member)ReturnsField.class
,Method.class
orConstructor.class
. -
toString
public static toString( member)Formats a member as concise string, such asjava.util.ArrayList.size
,java.util.ArrayList<init>()
orjava.util.List.remove()
. -
memberKey
public static memberKey( member) -
getGenericSupertype
public static getGenericSupertype( type, <?> rawType, <?> toResolve)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
public static resolveTypeVariable( type, <?> rawType, unknown)
-