@Override public boolean equals(Object obj) { if (!super.equals(obj)) { return false; } TypeVariableTypeInformation<?> that = (TypeVariableTypeInformation<?>) obj; return nullSafeEquals(this.owningType, that.owningType) && nullSafeEquals(this.variable, that.variable); }
@Override public int hashCode() { return super.hashCode() + (isResolvedCompletely() ? this.type.hashCode() : 0); }
@Override @SuppressWarnings("unchecked") public TypeInformation<? extends T> specialize(ClassTypeInformation<?> type) { return isResolvedCompletely() ? (TypeInformation<? extends T>) type : super.specialize(type); }
@Override public TypeInformation<?> getMapValueType() { if (Map.class.equals(getType())) { Type[] arguments = type.getActualTypeArguments(); return createInfo(arguments[1]); } Class<?> rawType = getType(); Set<Type> supertypes = new HashSet<Type>(); supertypes.add(rawType.getGenericSuperclass()); supertypes.addAll(Arrays.asList(rawType.getGenericInterfaces())); for (Type supertype : supertypes) { Class<?> rawSuperType = GenericTypeResolver.resolveType(supertype, getTypeVariableMap()); if (Map.class.isAssignableFrom(rawSuperType)) { ParameterizedType parameterizedSupertype = (ParameterizedType) supertype; Type[] arguments = parameterizedSupertype.getActualTypeArguments(); return createInfo(arguments[1]); } } return super.getMapValueType(); }
@Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (!(obj instanceof ParameterizedTypeInformation)) { return false; } ParameterizedTypeInformation<?> that = (ParameterizedTypeInformation<?>) obj; if (this.isResolved() && that.isResolved()) { return this.type.equals(that.type); } return super.equals(obj); }
@Override public int hashCode() { return isResolved() ? this.type.hashCode() : super.hashCode(); }
@Override public boolean equals(Object obj) { if (obj == this) { return true; } if (!(obj instanceof ParameterizedTypeInformation)) { return false; } ParameterizedTypeInformation<?> that = (ParameterizedTypeInformation<?>) obj; if (this.isResolvedCompletely() && that.isResolvedCompletely()) { return this.type.equals(that.type); } return super.equals(obj); }
@Override public int hashCode() { int result = super.hashCode(); result += 31 * nullSafeHashCode(this.owningType); result += 31 * nullSafeHashCode(this.variable); return result; } }