com.google.dexmaker
Class TypeId<T>

java.lang.Object
  extended by com.google.dexmaker.TypeId<T>

public final class TypeId<T>
extends Object

A primitive type, interface or class.

Warning: Use care when dealing with boxed primitive types. Java's lack of support for parameterized primitive types means that a primitive type like int and its boxed type java.lang.Integer have the same type parameter: TypeId<Integer>. These types are different and it will be a runtime error if the boxed type java.lang.Integer is used where the primitive type int is expected.


Field Summary
static TypeId<Boolean> BOOLEAN
          The boolean primitive type.
static TypeId<Byte> BYTE
          The byte primitive type.
static TypeId<Character> CHAR
          The char primitive type.
static TypeId<Double> DOUBLE
          The double primitive type.
static TypeId<Float> FLOAT
          The float primitive type.
static TypeId<Integer> INT
          The int primitive type.
static TypeId<Long> LONG
          The long primitive type.
static TypeId<Object> OBJECT
          The Object type.
static TypeId<Short> SHORT
          The short primitive type.
static TypeId<String> STRING
          The String type.
static TypeId<Void> VOID
          The void primitive type.
 
Method Summary
 boolean equals(Object o)
           
static
<T> TypeId<T>
get(Class<T> type)
           
static
<T> TypeId<T>
get(String name)
           
 MethodId<T,Void> getConstructor(TypeId<?>... parameters)
           
<V> FieldId<T,V>
getField(TypeId<V> type, String name)
           
<R> MethodId<T,R>
getMethod(TypeId<R> returnType, String name, TypeId<?>... parameters)
           
 String getName()
           
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BOOLEAN

public static final TypeId<Boolean> BOOLEAN
The boolean primitive type.


BYTE

public static final TypeId<Byte> BYTE
The byte primitive type.


CHAR

public static final TypeId<Character> CHAR
The char primitive type.


DOUBLE

public static final TypeId<Double> DOUBLE
The double primitive type.


FLOAT

public static final TypeId<Float> FLOAT
The float primitive type.


INT

public static final TypeId<Integer> INT
The int primitive type.


LONG

public static final TypeId<Long> LONG
The long primitive type.


SHORT

public static final TypeId<Short> SHORT
The short primitive type.


VOID

public static final TypeId<Void> VOID
The void primitive type. Only used as a return type.


OBJECT

public static final TypeId<Object> OBJECT
The Object type.


STRING

public static final TypeId<String> STRING
The String type.

Method Detail

get

public static <T> TypeId<T> get(String name)
Parameters:
name - a descriptor like "Ljava/lang/Class;".

get

public static <T> TypeId<T> get(Class<T> type)

getField

public <V> FieldId<T,V> getField(TypeId<V> type,
                                 String name)

getConstructor

public MethodId<T,Void> getConstructor(TypeId<?>... parameters)

getMethod

public <R> MethodId<T,R> getMethod(TypeId<R> returnType,
                                   String name,
                                   TypeId<?>... parameters)

getName

public String getName()

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object