Class Types


public abstract class Types extends Object
Contains utilities for working with Java types.
  • Constructor Details

    • Types

      public Types()
  • Method Details

    • forciblyCast

      public static <T> T forciblyCast(Object argument)
      There are some situations where we cannot appease javac's type checking, and we need to forcibly cast an object's type. Please don't use this method unless you have no choice.
      Type Parameters:
      T - the inferred type to which to cast the argument
      argument - the object to cast
      a cast version of the argument