AndBase开发框架  1.6
 全部  命名空间 文件 函数 变量 枚举值 
| 静态 Public 成员函数 | 静态包函数 | 静态包属性 | Private 成员函数 | 静态 Private 成员函数 | 所有成员列表
com.google.gson.internal.$Types类 参考

class  GenericArrayTypeImpl
 
class  ParameterizedTypeImpl
 
class  WildcardTypeImpl
 

静态 Public 成员函数

static ParameterizedType newParameterizedTypeWithOwner (Type ownerType, Type rawType, Type...typeArguments)
 
static GenericArrayType arrayOf (Type componentType)
 
static WildcardType subtypeOf (Type bound)
 
static WildcardType supertypeOf (Type bound)
 
static Type canonicalize (Type type)
 
static Class<?> getRawType (Type type)
 
static boolean equals (Type a, Type b)
 
static String typeToString (Type type)
 
static Type getArrayComponentType (Type array)
 
static Type getCollectionElementType (Type context, Class<?> contextRawType)
 
static Type[] getMapKeyAndValueTypes (Type context, Class<?> contextRawType)
 
static Type resolve (Type context, Class<?> contextRawType, Type toResolve)
 

静态包函数

static boolean equal (Object a, Object b)
 
static Type getGenericSupertype (Type context, Class<?> rawType, Class<?> toResolve)
 
static Type getSupertype (Type context, Class<?> contextRawType, Class<?> supertype)
 
static Type resolveTypeVariable (Type context, Class<?> contextRawType, TypeVariable<?> unknown)
 

静态包属性

static final Type[] EMPTY_TYPE_ARRAY = new Type[] {}
 

Private 成员函数

$Gson $Types ()
 

静态 Private 成员函数

static int hashCodeOrZero (Object o)
 
static int indexOf (Object[] array, Object toFind)
 
static Class<?> declaringClassOf (TypeVariable<?> typeVariable)
 
static void checkNotPrimitive (Type type)
 

详细描述

Static methods for working with types.

作者
Bob Lee
Jesse Wilson

构造及析构函数说明

$Gson com.google.gson.internal.$Types.$Types ( )
inlineprivate

成员函数说明

static GenericArrayType com.google.gson.internal.$Types.arrayOf ( Type  componentType)
inlinestatic

Returns an array type whose elements are all instances of

componentType

.

返回
a serializable generic array type.
static Type com.google.gson.internal.$Types.canonicalize ( Type  type)
inlinestatic

Returns a type that is functionally equal but not necessarily equal according to Object.equals(). The returned type is java.io.Serializable.

static void com.google.gson.internal.$Types.checkNotPrimitive ( Type  type)
inlinestaticprivate
static Class<?> com.google.gson.internal.$Types.declaringClassOf ( TypeVariable<?>  typeVariable)
inlinestaticprivate

Returns the declaring class of

typeVariable

, or

null

if it was not declared by a class.

static boolean com.google.gson.internal.$Types.equal ( Object  a,
Object  b 
)
inlinestaticpackage
static boolean com.google.gson.internal.$Types.equals ( Type  a,
Type  b 
)
inlinestatic

Returns true if

a

and

b

are equal.

static Type com.google.gson.internal.$Types.getArrayComponentType ( Type  array)
inlinestatic

Returns the component type of this array type.

异常
ClassCastExceptionif this type is not an array.
static Type com.google.gson.internal.$Types.getCollectionElementType ( Type  context,
Class<?>  contextRawType 
)
inlinestatic

Returns the element type of this collection type.

异常
IllegalArgumentExceptionif this type is not a collection.
static Type com.google.gson.internal.$Types.getGenericSupertype ( Type  context,
Class<?>  rawType,
Class<?>  toResolve 
)
inlinestaticpackage

Returns the generic supertype for

supertype

. For example, given a class

IntegerSet

, the result for when supertype is

Set.class

is

Set<Integer>

and the result when the supertype is

Collection.class

is

Collection<Integer>

.

static Type [] com.google.gson.internal.$Types.getMapKeyAndValueTypes ( Type  context,
Class<?>  contextRawType 
)
inlinestatic

Returns a two element array containing this map's key and value types in positions 0 and 1 respectively.

static Class<?> com.google.gson.internal.$Types.getRawType ( Type  type)
inlinestatic
static Type com.google.gson.internal.$Types.getSupertype ( Type  context,
Class<?>  contextRawType,
Class<?>  supertype 
)
inlinestaticpackage

Returns the generic form of

supertype

. For example, if this is

ArrayList<String>

, this returns

Iterable<String>

given the input

Iterable.class

.

参数
supertypea superclass of, or interface implemented by, this.
static int com.google.gson.internal.$Types.hashCodeOrZero ( Object  o)
inlinestaticprivate
static int com.google.gson.internal.$Types.indexOf ( Object[]  array,
Object  toFind 
)
inlinestaticprivate
static ParameterizedType com.google.gson.internal.$Types.newParameterizedTypeWithOwner ( Type  ownerType,
Type  rawType,
Type...  typeArguments 
)
inlinestatic

Returns a new parameterized type, applying

typeArguments

to

rawType

and enclosed by

ownerType

.

返回
a serializable parameterized type.
static Type com.google.gson.internal.$Types.resolve ( Type  context,
Class<?>  contextRawType,
Type  toResolve 
)
inlinestatic
static Type com.google.gson.internal.$Types.resolveTypeVariable ( Type  context,
Class<?>  contextRawType,
TypeVariable<?>  unknown 
)
inlinestaticpackage
static WildcardType com.google.gson.internal.$Types.subtypeOf ( Type  bound)
inlinestatic

Returns a type that represents an unknown type that extends

bound

. For example, if

bound

is

CharSequence.class

, this returns

? extends CharSequence

. If

bound

is

Object.class

, this returns

?

, which is shorthand for

? extends Object

.

static WildcardType com.google.gson.internal.$Types.supertypeOf ( Type  bound)
inlinestatic

Returns a type that represents an unknown supertype of

bound

. For example, if

bound

is

String.class

, this returns

?
super String

.

static String com.google.gson.internal.$Types.typeToString ( Type  type)
inlinestatic

类成员变量说明

final Type [] com.google.gson.internal.$Types.EMPTY_TYPE_ARRAY = new Type[] {}
staticpackage

该类的文档由以下文件生成: