Class OutputType<T>

java.lang.Object
dev.dokimos.core.OutputType<T>
Type Parameters:
T - the captured output type

public abstract class OutputType<T> extends Object
A super-type token that captures a full generic type T (including its type arguments) at compile time so it survives erasure at runtime.

It lets the typed output accessors convert a stored value into a generic target such as List<Whisky>, which a plain Class<T> cannot express.

Always instantiate it as an anonymous subclass so the type argument is recorded in the class's generic supertype:


 OutputType<List<Whisky>> type = new OutputType<>() {};
 List<Whisky> whiskies = testCase.actualOutputAs(type);
 

For a non-generic target, use a plain Class<T> accessor instead.

  • Method Details

    • getType

      public final Type getType()
      The captured generic type.
      Returns:
      the captured Type
    • equals

      public final boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public final int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public final String toString()
      Overrides:
      toString in class Object