@Override public int hashCode() { return Objects.hashCode( hitCount, missCount, loadSuccessCount, loadExceptionCount, totalLoadTime, evictionCount); }
@Override public boolean equals(Object other) { if (!(other instanceof ServerCallInfoImpl)) { return false; } ServerCallInfoImpl<?, ?> that = (ServerCallInfoImpl) other; return Objects.equal(methodDescriptor, that.methodDescriptor) && Objects.equal(attributes, that.attributes) && Objects.equal(authority, that.authority); }
/** * {@inheritDoc} * * <p><b>Note:</b> This hash code is consistent with exact equality of the calculated statistics, * including the floating point values. See the note on {@link #equals} for details. */ @Override public int hashCode() { return Objects.hashCode(count, mean, sumOfSquaresOfDeltas, min, max); }
/** * Returns true if the {@link Subchannel}, {@link Status}, and * {@link ClientStreamTracer.Factory} all match. */ @Override public boolean equals(Object other) { if (!(other instanceof PickResult)) { return false; } PickResult that = (PickResult) other; return Objects.equal(subchannel, that.subchannel) && Objects.equal(status, that.status) && Objects.equal(streamTracerFactory, that.streamTracerFactory) && drop == that.drop; } }
/** * Hash codes on Statuses are not well defined. * * @see #equals */ @Override public int hashCode() { return Objects.hashCode(canonicalCode, description); }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } PickSubchannelArgsImpl that = (PickSubchannelArgsImpl) o; return Objects.equal(callOptions, that.callOptions) && Objects.equal(headers, that.headers) && Objects.equal(method, that.method); }
@Override public int hashCode() { return Objects.hashCode(type, comparator); }
@Override public int hashCode() { return Objects.hashCode(numHashFunctions, funnel, strategy, bits); }
/** * Equality on Statuses is not well defined. Instead, do comparison based on their CanonicalCode * with {@link #getCanonicalCode}. The description of the Status is unlikely to be stable, and * additional fields may be added to Status in the future. */ @Override public boolean equals(@Nullable Object obj) { if (obj == this) { return true; } if (!(obj instanceof Status)) { return false; } Status that = (Status) obj; return canonicalCode == that.canonicalCode && Objects.equal(description, that.description); }
@Override public int hashCode() { return Objects.hashCode(traceId, spanId, traceOptions); }
static <T> void logGet(String key, T value, T defaultValue) { LOG.info("{} = {} ({})", key, value, Objects.equal(value, defaultValue)? "default": "custom"); }
@Override public int hashCode() { return Objects.hashCode(subchannel, status, streamTracerFactory, drop); }
/** * Checks whether the given item exists in the iterable. This is copied from Guava Collect's * {@code Iterables.contains()} because Guava Collect is not Android-friendly thus core can't * depend on it. */ static <T> boolean iterableContains(Iterable<T> iterable, T item) { if (iterable instanceof Collection) { Collection<?> collection = (Collection<?>) iterable; try { return collection.contains(item); } catch (NullPointerException e) { return false; } catch (ClassCastException e) { return false; } } for (T i : iterable) { if (Objects.equal(i, item)) { return true; } } return false; }
@Override public int hashCode() { return Objects.hashCode(proxyAddress, username, password); } }
@Override public boolean equals(Object obj) { if (obj instanceof GenericArrayType) { GenericArrayType that = (GenericArrayType) obj; return Objects.equal(getGenericComponentType(), that.getGenericComponentType()); } return false; }
@Override public int hashCode() { return Objects.hashCode(function, resultEquivalence); }
@Override public boolean equals(@NullableDecl Object obj) { if (this == obj) { return true; } if (obj instanceof EquivalentToPredicate) { EquivalentToPredicate<?> that = (EquivalentToPredicate<?>) obj; return equivalence.equals(that.equivalence) && Objects.equal(target, that.target); } return false; }
@Override public int hashCode() { return Objects.hashCode(stream, reason); }