Package fj

Class Class<T>

java.lang.Object
fj.Class<T>

public final class Class<T> extends Object
A wrapper for a Class that provides additional methods.
  • Field Details

    • c

      private final Class<T> c
  • Constructor Details

    • Class

      private Class(Class<T> c)
  • Method Details

    • inheritance

      public List<Class<? super T>> inheritance()
      Returns the inheritance hierarchy of this class.
      Returns:
      The inheritance hierarchy of this class.
    • classParameters

      public Tree<Type> classParameters()
      Provides this class's type parameter information as a Tree of the type expression. Only descends into Parameterized classes. Non-abstract classes, or classes that don't implement an interface, are treated as raw types. Arrays, Type Variables, and Wildcards are treated as opaque Types.
      Returns:
      The rose tree representing the type expression for this class.
    • superclassParameters

      public Tree<Type> superclassParameters()
      Provides this class's superclass type parameter information as a Tree of the type expression. Only descends into Parameterized classes. Non-abstract classes, or classes that don't implement an interface, are treated as raw types. Arrays, Type Variables, and Wildcards are treated as opaque Types.
      Returns:
      The Tree representing the type expression for this class's superclass.
    • interfaceParameters

      public List<Tree<Type>> interfaceParameters()
      Provides this class's interface type parameter information as a list of trees.
      Returns:
      A list of trees representing the type expressions for this class's interfaces.
    • typeParameterTree

      public static Tree<Type> typeParameterTree(Type t)
      Provides type parameter information as a Tree of the type expression. Only descends into Parameterized classes. Non-abstract classes, or classes that don't implement an interface, are treated as raw types. Arrays, Type Variables, and Wildcards are treated as opaque Types.
      Parameters:
      t - The type (class) for which to get the generic type information.
      Returns:
      Type parameter information as a rose tree of the type expression.
    • clas

      public Class<T> clas()
      Returns the underlying class.
      Returns:
      The underlying class.
    • clas

      public static <T> Class<T> clas(Class<T> c)
      Constructs a class from the given argument.
      Parameters:
      c - The argument to construct this class with.
      Returns:
      A class from the given argument.