Class WildcardUtil

java.lang.Object
com.ryanharter.auto.value.gson.internal.WildcardUtil

@CheckReturnValue public final class WildcardUtil extends Object
Factory methods for types. Adapted from Moshi.
  • Method Details

    • subtypeOf

      public static WildcardType subtypeOf(Type bound)
      Returns a type that represents an unknown type that extends bound. For example, if bound is CharSequence.class, this returns ? extends CharSequence. If bound is Object.class, this returns ?, which is shorthand for ? extends Object.
    • supertypeOf

      public static WildcardType supertypeOf(Type bound)
      Returns a type that represents an unknown supertype of bound. For example, if bound is String.class, this returns ? super String.