|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.sonatype.guice.bean.reflect.TypeParameters
public final class TypeParameters
Utility methods for dealing with generic type parameters and arguments.
| Method Summary | |
|---|---|
static com.google.inject.TypeLiteral<?>[] |
get(com.google.inject.TypeLiteral<?> typeLiteral)
Get all type arguments from a generic type, for example [Foo,Bar] from Map<Foo,Bar>. |
static com.google.inject.TypeLiteral<?> |
get(com.google.inject.TypeLiteral<?> typeLiteral,
int index)
Get an indexed type argument from a generic type, for example Bar from Map<Foo,Bar>. |
static boolean |
isAssignableFrom(com.google.inject.TypeLiteral<?> superLiteral,
com.google.inject.TypeLiteral<?> subLiteral)
Determines if the sub-type can be converted to the generic super-type via an identity or widening conversion. |
static boolean |
isConcrete(Class<?> clazz)
Determines if the given raw type represents a concrete type. |
static boolean |
isConcrete(com.google.inject.TypeLiteral<?> literal)
Determines if the given generic type represents a concrete type. |
static boolean |
isImplicit(Class<?> clazz)
Determines if the given raw type represents an implicit binding. |
static boolean |
isImplicit(com.google.inject.TypeLiteral<?> literal)
Determines if the given generic type represents an implicit binding. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static com.google.inject.TypeLiteral<?>[] get(com.google.inject.TypeLiteral<?> typeLiteral)
[Foo,Bar] from Map<Foo,Bar>.
typeLiteral - The generic type
public static com.google.inject.TypeLiteral<?> get(com.google.inject.TypeLiteral<?> typeLiteral,
int index)
Bar from Map<Foo,Bar>.
typeLiteral - The generic typeindex - The argument index
TypeLiteral<Object> if the given type is a raw class
public static boolean isAssignableFrom(com.google.inject.TypeLiteral<?> superLiteral,
com.google.inject.TypeLiteral<?> subLiteral)
superLiteral - The generic super-typesubLiteral - The generic sub-type
true if the sub-type can be converted to the generic super-type; otherwise falseClass.isAssignableFrom(Class)public static boolean isConcrete(com.google.inject.TypeLiteral<?> literal)
literal - The generic type
true if the generic type is concrete; otherwise falsepublic static boolean isConcrete(Class<?> clazz)
clazz - The raw type
true if the raw type is concrete; otherwise falsepublic static boolean isImplicit(com.google.inject.TypeLiteral<?> literal)
clazz - The generic type
true if the generic type is implicit; otherwise falsepublic static boolean isImplicit(Class<?> clazz)
clazz - The raw type
true if the raw type is implicit; otherwise false
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||