public abstract class TypeReference<T extends Type> extends java.lang.Object implements java.lang.Comparable<TypeReference<T>>
Array types.
See this blog post for further details.
It may make sense to switch to using Java's reflection Type to avoid working around this fundamental generics limitation.
| 限定符和类型 | 类和说明 |
|---|---|
static class |
TypeReference.StaticArrayTypeReference<T extends Type> |
| 限定符和类型 | 字段和说明 |
|---|---|
protected static java.util.regex.Pattern |
ARRAY_SUFFIX |
protected static java.util.regex.Pattern |
TUPLE_PREFIX |
| 限定符 | 构造器和说明 |
|---|---|
protected |
TypeReference() |
protected |
TypeReference(boolean indexed) |
protected |
TypeReference(java.lang.reflect.Type type) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
compareTo(TypeReference<T> o) |
static <T extends Type> |
create(java.lang.Class<T> cls) |
static <T extends Type> |
create(java.lang.Class<T> cls,
boolean indexed) |
static <T extends Type> |
create(java.lang.reflect.Type type) |
protected static java.lang.Class<? extends Type> |
getAtomicTypeClass(java.lang.String type)
This is a helper method that only works for atomic types (uint, bytes, etc).
|
java.lang.Class<T> |
getClassType()
Workaround to ensure type does not come back as T due to erasure, this enables you to create
a TypeReference via
Class<T>. |
T |
getRawType() |
java.lang.reflect.Type |
getType() |
boolean |
isIndexed() |
static TypeReference |
makeTypeReference(java.lang.String type,
boolean indexed) |
protected static java.util.regex.Pattern ARRAY_SUFFIX
protected static java.util.regex.Pattern TUPLE_PREFIX
protected TypeReference()
protected TypeReference(boolean indexed)
protected TypeReference(java.lang.reflect.Type type)
public int compareTo(TypeReference<T> o)
compareTo 在接口中 java.lang.Comparable<TypeReference<T extends Type>>public java.lang.reflect.Type getType()
public boolean isIndexed()
public java.lang.Class<T> getClassType() throws java.lang.ClassNotFoundException
Class<T>.java.lang.ClassNotFoundException - if the class type cannot be determinedpublic T getRawType() throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundExceptionpublic static <T extends Type> TypeReference<T> create(java.lang.Class<T> cls)
public static <T extends Type> TypeReference<T> create(java.lang.Class<T> cls, boolean indexed)
public static <T extends Type> TypeReference<T> create(java.lang.reflect.Type type)
protected static java.lang.Class<? extends Type> getAtomicTypeClass(java.lang.String type) throws java.lang.ClassNotFoundException
ParameterizedType.type - type name in stringTypejava.lang.ClassNotFoundException - throw when can not find any class match the param typepublic static TypeReference makeTypeReference(java.lang.String type, boolean indexed) throws java.lang.ClassNotFoundException
java.lang.ClassNotFoundException