Class JavaType

    • Field Detail

      • EMPTY_JAVA_TYPE_ARRAY

        public static final JavaType[] EMPTY_JAVA_TYPE_ARRAY
      • OBJECT_JAVA_TYPE

        public static final JavaType OBJECT_JAVA_TYPE
      • NULL_JAVA_TYPE

        public static final JavaType NULL_JAVA_TYPE
    • Constructor Detail

      • JavaType

        protected JavaType​(java.lang.reflect.Type type)
      • JavaType

        protected JavaType​(java.lang.reflect.Type type,
                           JavaType.Kind kind)
      • JavaType

        protected JavaType​(java.lang.reflect.Type type,
                           JavaType source)
    • Method Detail

      • getType

        @Nonnull
        public java.lang.reflect.Type getType()
      • getRawType

        @Nullable
        public java.lang.reflect.Type getRawType()
      • resolveSuperType

        protected JavaType resolveSuperType()
      • resolveInterfaces

        protected JavaType[] resolveInterfaces()
      • getInterface

        @Nonnull
        public JavaType getInterface​(int interfaceIndex)
                              throws java.lang.IndexOutOfBoundsException
        Throws:
        java.lang.IndexOutOfBoundsException
      • getGenericType

        @Nonnull
        public JavaType getGenericType​(int genericTypeIndex)
                                throws java.lang.IndexOutOfBoundsException
        Throws:
        java.lang.IndexOutOfBoundsException
      • as

        @Nullable
        public JavaType as​(java.lang.Class<?> targetClass)
        Get the JavaType presenting the target class
        Parameters:
        targetClass - the target class
        Returns:
        null if can't cast to the target class
      • toClass

        @Nullable
        public <T> java.lang.Class<T> toClass()
      • toParameterizedType

        @Nullable
        public java.lang.reflect.ParameterizedType toParameterizedType()
      • toTypeVariable

        @Nullable
        public java.lang.reflect.TypeVariable toTypeVariable()
      • toWildcardType

        @Nullable
        public java.lang.reflect.WildcardType toWildcardType()
      • toGenericArrayType

        @Nullable
        public java.lang.reflect.GenericArrayType toGenericArrayType()
      • isSource

        public boolean isSource()
      • isRootSource

        public boolean isRootSource()
      • isClass

        public boolean isClass()
      • isParameterizedType

        public boolean isParameterizedType()
      • isTypeVariable

        public boolean isTypeVariable()
      • isWildCardType

        public boolean isWildCardType()
      • isGenericArrayType

        public boolean isGenericArrayType()
      • isUnknownType

        public boolean isUnknownType()
      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • from

        @Nonnull
        public static JavaType from​(java.lang.reflect.Field field)
      • fromMethodReturnType

        @Nonnull
        public static JavaType fromMethodReturnType​(java.lang.reflect.Method method)
      • fromMethodParameters

        @Nonnull
        public static JavaType[] fromMethodParameters​(java.lang.reflect.Method method)
      • fromMethodParameter

        @Nonnull
        public static JavaType fromMethodParameter​(java.lang.reflect.Method method,
                                                   int parameterIndex)
      • from

        @Nonnull
        public static JavaType from​(java.lang.Class<?> targetClass)
      • from

        @Nonnull
        protected static JavaType[] from​(java.lang.reflect.Type[] types)