Code example for WildcardType

Methods: getLowerBoundsgetUpperBounds

0
        if (generic instanceof Class<?>)
            return (Class<?>) generic;
 
        if (generic instanceof WildcardType) {
            WildcardType wildcarded = (WildcardType) generic;
            if (wildcarded.getLowerBounds().length == 0 && Object.class.equals(wildcarded.getUpperBounds()[0]))
                return String.class;
        } 
 
        throw new UnsupportedValueTypeException(type);
    } 
 
    @Override public Object nilValue() {
        return new ArrayList<Object>(0);
    } 
} 
Experience pair programming with AI  Get Codota for Java