接口 TypeReference

所有超级接口:
Comparable<TypeReference>
所有已知实现类:
AbstractTypeReference, GeneratedTypeReference, ReflectionTypeReference, SimpleTypeReference

public interface TypeReference extends Comparable<TypeReference>
Type abstraction that can be used to refer to types that are not available as a Class yet.
从以下版本开始:
4.0
作者:
Stephane Nicoll, Sebastien Deleuze, Harry Yang
  • 方法详细资料

    • getName

      String getName()
      Return the fully qualified name of this type reference.
      返回:
      the reflection target name
    • getCanonicalName

      String getCanonicalName()
      Return the canonical name of this type reference.
      返回:
      the canonical name
    • getPackageName

      String getPackageName()
      Return the package name of this type.
      返回:
      the package name
    • getSimpleName

      String getSimpleName()
      Return the simple name of this type reference.
      返回:
      the simple name
    • getEnclosingType

      @Nullable TypeReference getEnclosingType()
      Return the enclosing type reference, or null if this type reference does not have an enclosing type.
      返回:
      the enclosing type, if any
    • of

      static TypeReference of(Class<?> type)
      Create an instance based on the specified type.
      参数:
      type - the type to wrap
      返回:
      a type reference for the specified type
      抛出:
      IllegalArgumentException - if the specified type canonical name is null
    • of

      static TypeReference of(String className)
      Create an instance based on the specified class name. The format of the class name must follow Class.getName(), in particular inner classes should be separated by a $.
      参数:
      className - the class name of the type to wrap
      返回:
      a type reference for the specified class name
    • listOf

      static List<TypeReference> listOf(Class<?>... types)
      Create a list of type references mapped by the specified types.
      参数:
      types - the types to map
      返回:
      a list of type references