Code example for WildcardType

Methods: getLowerBounds

      GenericArrayType g = (GenericArrayType) type;
      return new GenericArrayTypeImpl(g.getGenericComponentType());
    } else if (type instanceof WildcardType) {
      WildcardType w = (WildcardType) type;
      return new WildcardTypeImpl(w.getUpperBounds(), w.getLowerBounds());
    } else { 
      // type is either serializable as-is or unsupported 
      return type;
  public static Class<?> getRawType(Type type) {
    if (type instanceof Class<?>) {
      // type is a normal class. 
      return (Class<?>) type;
    } else if (type instanceof ParameterizedType) {
      ParameterizedType parameterizedType = (ParameterizedType) type;
Connect your IDE to all the code out there  Get Codota for Java