Class ATypeRef<T>

  • Type Parameters:
    T - The (static) Java type to capture.
    All Implemented Interfaces:
    IDynamicType<T>, ITypeRef<T>

    public abstract class ATypeRef<T>
    extends ATypeRefIdentity<T>
    Abstract implementation of ITypeRef used to statically capture a parameterized (generic) Java type. If you the type T is not parameterized, you may prefer ITypeRef.of(Class) as being simpler. To use this class one should create an anonymous class new ATypeRef<List<String>>(){}. By constructing the anonymous class we are able to use the Java reflection API in ATypeRef() to ensure that getType() returns List<String> as an instance of ParameterizedType.
    • Field Detail

      • type

        protected final Type type
    • Constructor Detail

      • ATypeRef

        protected ATypeRef()
    • Method Detail

      • getType

        public Type getType()
        Description copied from interface: ITypeRef
        Get the dynamic (runtime) type of T.
        Returns:
        The dynamic (runtime) type of T.