@Override public int hashCode() { return member.hashCode() ^ declaringType.hashCode(); }
/** Computes the hash code for this key. */ private int computeHashCode() { return typeLiteral.hashCode() * 31 + annotationStrategy.hashCode(); }
@Override public int hashCode() { return member.hashCode() ^ declaringType.hashCode(); }
/** * Computes the hash code for this key. */ private int computeHashCode() { return typeLiteral.hashCode() * 31 + annotationStrategy.hashCode(); }
@Override public int hashCode() { return member.hashCode() ^ declaringType.hashCode(); }
/** Computes the hash code for this key. */ private int computeHashCode() { return typeLiteral.hashCode() * 31 + annotationStrategy.hashCode(); }
/** Computes the hash code for this key. */ private int computeHashCode() { return typeLiteral.hashCode() * 31 + annotationStrategy.hashCode(); }
@Override public int hashCode() { return member.hashCode() ^ declaringType.hashCode(); }
@Override public int hashCode() { return member.hashCode() ^ declaringType.hashCode(); }
private int computeHashCode() { return typeLiteral.hashCode() * 31 + annotationStrategy.hashCode(); }
private int computeHashCode() { return typeLiteral.hashCode() * 31 + annotationStrategy.hashCode(); }
@Override public int hashCode() { return member.hashCode() ^ declaringType.hashCode(); }
private int computeHashCode() { return typeLiteral.hashCode() * 31 + annotationStrategy.hashCode(); }
@Override public int hashCode() { return member.hashCode() ^ declaringType.hashCode(); }
private int computeHashCode() { return typeLiteral.hashCode() * 31 + annotationStrategy.hashCode(); }
static int hashCode(Type type) { if (type instanceof ParameterizedType) { ParameterizedType p = (ParameterizedType) type; int h = p.getRawType().hashCode(); for (Type argument : p.getActualTypeArguments()) { h = h * 31 + hashCode(argument); } return h; } if (type instanceof Class) { // Class specifies hashCode(). return type.hashCode(); } if (type instanceof GenericArrayType) { return hashCode(((GenericArrayType) type).getGenericComponentType()) * 31; } // This isn't a type we support. Could be a generic array type, wildcard // type, etc. return type.hashCode(); }
/** * Unsafe. Constructs a type literal manually. */ @SuppressWarnings("unchecked") TypeLiteral(Type type) { this.rawType = (Class<? super T>) getRawType(nonNull(type, "type")); this.type = type; this.hashCode = hashCode(type); }
/** * Constructs a new type literal. Derives represented class from type * parameter. * * <p>Clients create an empty anonymous subclass. Doing so embeds the type * parameter in the anonymous class's type hierarchy so we can reconstitute it * at runtime despite erasure. */ @SuppressWarnings("unchecked") protected TypeLiteral() { this.type = getSuperclassTypeParameter(getClass()); this.rawType = (Class<? super T>) getRawType(type); this.hashCode = hashCode(type); }