TYPE - the class type.public abstract class ClassToken<TYPE> extends Object
Class<List<String>> as
opposed to Class<List<Integer>>.
-keepattributes Signature
Created by davide-maestroni on 06/14/2014.| Constructor and Description |
|---|
ClassToken() |
| Modifier and Type | Method and Description |
|---|---|
TYPE |
cast(Object object)
Casts the specified object to this token type.
|
boolean |
equals(Object o) |
Type |
getGenericType()
Gets the generic type of this token.
|
Class<TYPE> |
getRawClass()
Gets the raw class of this token.
|
int |
hashCode() |
boolean |
isAssignableFrom(ClassToken<?> other)
Checks if this token raw class is equal to or is a superclass of the specified one.
|
boolean |
isInterface()
Checks if this token raw class represents an interface.
|
static <TYPE> ClassToken<TYPE> |
tokenOf(Class<TYPE> rawClass)
Creates a new token from the specified raw class.
|
static <TYPE> ClassToken<TYPE> |
tokenOf(TYPE object)
Creates a new token from the class of the specified object.
|
@NotNull public static <TYPE> ClassToken<TYPE> tokenOf(@NotNull Class<TYPE> rawClass)
TYPE - the class type.rawClass - the raw class.@NotNull public static <TYPE> ClassToken<TYPE> tokenOf(@NotNull TYPE object)
TYPE - the class type.object - the object.public final TYPE cast(Object object)
object - the object to cast.@NotNull public final Type getGenericType()
@NotNull public final Class<TYPE> getRawClass()
IllegalStateException - if this class does not correctly extend a class
token.public final boolean isAssignableFrom(@NotNull
ClassToken<?> other)
other - the class token to compare.IllegalStateException - if this class does not correctly extend a class
token.public final boolean isInterface()
IllegalStateException - if this class does not correctly extend a class
token.