@Override public Type<?> getExtendsBound() { if (_isGenericParameter) { return _extendsBound != null ? _extendsBound : Types.Object; } return super.getExtendsBound(); }
@Override public ImmutableList<Type<?>> visitWildcardType(final Type<?> type, final ImmutableList<Type<?>> list) { return visit(type.getExtendsBound()); } };
@Override public Type visitCapturedType(final Type t, final Void ignored) { return visit(t.getExtendsBound()); } };
@Override public Type visitTypeParameter(final Type t, final Type p) { if (t == p) { return t; } return asSuper(t.getExtendsBound(), p); }
@Override public Integer visitWildcardType(final Type t, final Void ignored) { int result = t.getKind().hashCode(); if (t.getExtendsBound() != null) { result *= 127; result += visit(t.getExtendsBound()); } return result; }
public Boolean visitType(final Type t, final Type s) { if (t.isGenericParameter()) { return isSubtypeNoCapture(t.getExtendsBound(), s); } return Boolean.FALSE; }
public Boolean visitType(final Type t, final Type s) { if (t.isGenericParameter()) { return isSubtypeNoCapture(t.getExtendsBound(), s); } return Boolean.FALSE; }
public Boolean visitType(final Type t, final Type s) { if (t.isGenericParameter()) { return isSubtypeNoCapture(t.getExtendsBound(), s); } return Boolean.FALSE; }
public boolean isUnbounded() { return isWildcardType() && getSuperBound() == Bottom && getExtendsBound() == Types.Object; }
public static boolean isSuperType(final Type type, final Type other) { if (type == other || other == Type.Bottom) { return true; } if (type.isGenericParameter()) { return isSuperType(type.getExtendsBound(), other); } return isSubtype(other, type); }
@Override public Type visitTypeParameter(final Type t, final Void ignored) { final Type bound = t.getExtendsBound(); if (!bound.isCompoundType() && !bound.isInterface()) { return bound; } return superType(bound); }
public SignatureType(final Type<?> returnType, final TypeList parameterTypes) { VerifyArgument.notNull(returnType, "returnType"); VerifyArgument.notNull(parameterTypes, "parameterTypes"); _returnType = returnType.isWildcardType() ? returnType.getExtendsBound() : returnType; _parameterTypes = parameterTypes; }
@Override public Type visitTypeParameter(final Type t, final Void ignored) { final Type bound = t.getExtendsBound(); if (!bound.isCompoundType() && !bound.isInterface()) { return bound; } return superType(bound); }
@Override public Type visitTypeParameter(final Type t, final Void ignored) { final Type bound = t.getExtendsBound(); if (!bound.isCompoundType() && !bound.isInterface()) { return bound; } return superType(bound); }
@Override public Type<?> visitWildcardType(final Type<?> type, final TypeBindings bindings) { final Type<?> oldLower = type.getSuperBound(); final Type<?> oldUpper = type.getExtendsBound(); final Type<?> newLower = visit(oldLower, bindings); final Type<?> newUpper = visit(oldUpper, bindings); if (newLower != oldLower || newUpper != oldUpper) { return new WildcardType<>(newUpper, newLower); } return type; }
@Override public Type<?> visitWildcardType(final Type<?> type, final TypeBindings bindings) { final Type<?> oldLower = type.getSuperBound(); final Type<?> oldUpper = type.getExtendsBound(); final Type<?> newLower = visit(oldLower, bindings); final Type<?> newUpper = visit(oldUpper, bindings); if (newLower != oldLower || newUpper != oldUpper) { return new WildcardType<>(newUpper, newLower); } return type; }
@Override public Boolean visitTypeParameter(final Type type, final Type parameter) { return StringUtilities.equals(type.getFullName(), parameter.getFullName()) && Comparer.equals(type.getDeclaringType(), parameter.getDeclaringType()) && Comparer.equals(type.getDeclaringMethod(), parameter.getDeclaringMethod()) && visit(type.getExtendsBound(), parameter.getExtendsBound()); }
@Override public Boolean visitTypeParameter(final Type type, final Type parameter) { return StringUtilities.equals(type.getFullName(), parameter.getFullName()) && Comparer.equals(type.getDeclaringType(), parameter.getDeclaringType()) && Comparer.equals(type.getDeclaringMethod(), parameter.getDeclaringMethod()) && visit(type.getExtendsBound(), parameter.getExtendsBound()); }
@Override public ImmutableList<Type<?>> visitTypeParameter(final Type<?> t, final ImmutableList<Type<?>> list) { final Type upperBound = t.getExtendsBound(); if (upperBound.isCompoundType()) { return interfaces(upperBound); } if (upperBound.isInterface()) { return ImmutableList.<Type<?>>of(upperBound); } return ImmutableList.empty(); }
@Override public ImmutableList<Type<?>> visitTypeParameter(final Type<?> t, final ImmutableList<Type<?>> list) { final Type upperBound = t.getExtendsBound(); if (upperBound.isCompoundType()) { return interfaces(upperBound); } if (upperBound.isInterface()) { return ImmutableList.<Type<?>>of(upperBound); } return ImmutableList.empty(); }