Interface TypeInformation<T>

Type Parameters:
T - The generic type
All Superinterfaces:
AnnotationMetadataProvider, AnnotationSource, Type, TypeVariableResolver
All Known Subinterfaces:
Argument<T>, ArgumentValue<V>, GenericPlaceholder<T>, MutableArgumentValue<V>, ReturnType<T>
All Known Implementing Classes:
ArgumentBeanType, DefaultArgument, GenericArgument

public interface TypeInformation<T> extends TypeVariableResolver, AnnotationMetadataProvider, Type
Provides information about a type at runtime.
Since:
2.4.0
Author:
graemerocher
  • Method Details

    • getType

      @NonNull @NonNull Class<T> getType()
      Returns:
      The type
    • isPrimitive

      default boolean isPrimitive()
      Returns:
      Is the type primitive.
      Since:
      3.0.0
    • getWrapperType

      default Class<?> getWrapperType()
      If the type is primitive returns the wrapper type, otherwise returns the actual type.
      Returns:
      The wrapper type if primitive
    • getTypeName

      @NonNull default @NonNull String getTypeName()
      Specified by:
      getTypeName in interface Type
    • isReactive

      default boolean isReactive()
      Returns:
      Is the return type reactive.
      Since:
      2.0.0
    • isWrapperType

      default boolean isWrapperType()
      Returns whether this type is a wrapper type that wraps the actual type such as an Optional or a Response wrapper.
      Returns:
      True if it is a wrapper type.
      Since:
      2.4.0
    • getWrappedType

      default Argument<?> getWrappedType()
      Returns the wrapped type in the case where isWrapperType() returns true.
      Returns:
      The wrapped type
    • isCompletable

      default boolean isCompletable()
      Returns:
      Is the return type a reactive completable type.
      Since:
      2.0.0
    • isAsync

      default boolean isAsync()
      Returns:
      Is the return type asynchronous.
      Since:
      2.0.0
    • isAsyncOrReactive

      default boolean isAsyncOrReactive()
      Returns:
      Is the return type either async or reactive.
      Since:
      2.0.0
    • isContainerType

      default boolean isContainerType()
      Returns:
      Whether this is a container type.
    • hasTypeVariables

      default boolean hasTypeVariables()
      Returns:
      Whether the argument has any type variables
    • getTypeString

      default String getTypeString(boolean simple)
      Returns the string representation of the argument type, including generics.
      Parameters:
      simple - If true, output the simple name of types
      Returns:
      The type string representation
    • isVoid

      default boolean isVoid()
      Returns whether the return type is logically void. This includes reactive times that emit nothing (such as io.micronaut.core.async.subscriber.Completable) and asynchronous types that emit Void.
      Returns:
      Is the return type logically void.
      Since:
      2.0.0
    • isOptional

      default boolean isOptional()
      Returns:
      Is the return type Optional.
      Since:
      2.0.1
    • isSpecifiedSingle

      default boolean isSpecifiedSingle()
      Returns:
      Has the return type been specified to emit a single result with SingleResult.
      Since:
      2.0
    • asType

      @NonNull default @NonNull Type asType()
      Represent this argument as a Type.
      Returns:
      The Type
      Since:
      3.5.2
    • asParameterizedType

      @NonNull default @NonNull ParameterizedType asParameterizedType()
      Represent this argument as a ParameterizedType.
      Returns:
      The ParameterizedType
      Since:
      2.0.0
    • isArray

      default boolean isArray()
      Returns:
      Is the type an array.
      Since:
      2.4.0
    • getSimpleName

      @NonNull default @NonNull String getSimpleName()
      Obtains the type's simple name.
      Returns:
      The simple name
      Since:
      3.0.0
    • isProvider

      default boolean isProvider()