/** * Create a type token for the given class. * * <p>This method should be preferred over {@link TypeToken#of(Class)} as the result may be * interned when not in development. * * @param clazz the class * @param <T> the type * @return a type token for the given class * @since 1.1.0 */ public static <T> TypeToken<T> token(Class<T> clazz) { return TypeCaching.typeToken(clazz); }
/** * Create a type token for the given runtime type. * * <p>This method should be preferred over {@link TypeToken#of(Type)} as the result may be * interned when not in development. * * @param type the type * @return a type token for the given type * @since 1.1.0 */ public static TypeToken<?> token(Type type) { return TypeCaching.typeToken(type); }