Code example for WildcardType

Methods: getLowerBounds

0
	 * @param variable The type variable where the wildcard is a parameter for. 
	 */ 
	public CaptureTypeImpl(WildcardType wildcard, TypeVariable<?> variable) {
		this.wildcard = wildcard;
		this.variable = variable;
		this.lowerBounds = wildcard.getLowerBounds();
	} 
	 
	/** 
	 * Initialize this CaptureTypeImpl. 
	 * This is needed for type variable bounds referring to each other: we need the capture of the argument. 
	 */ 
	void init(VarMap varMap) {
		ArrayList<Type> upperBoundsList = new ArrayList<Type>();
		upperBoundsList.addAll(Arrays.asList(varMap.map(variable.getBounds())));
		 
		List<Type> wildcardUpperBounds = Arrays.asList(wildcard.getUpperBounds());
		if (wildcardUpperBounds.size() > 0 && wildcardUpperBounds.get(0) == Object.class) {
			// skip the Object bound, we already have a first upper bound from 'variable' 
			upperBoundsList.addAll(wildcardUpperBounds.subList(1, wildcardUpperBounds.size()));
Contextual code suggestions in your IDE  Get Codota for Java