/** * A sensible definition of {@link #toString} in terms of {@link #getKey} and {@link #getValue}. * If you override either of these methods, you may wish to override {@link #equals} to forward to * this implementation. * * @since 7.0 */ @Beta protected String standardToString() { return getKey() + "=" + getValue(); } }
/** * A sensible definition of {@link #hashCode()} in terms of {@link #getKey()} and {@link * #getValue()}. If you override either of these methods, you may wish to override {@link * #hashCode()} to forward to this implementation. * * @since 7.0 */ protected int standardHashCode() { K k = getKey(); V v = getValue(); return ((k == null) ? 0 : k.hashCode()) ^ ((v == null) ? 0 : v.hashCode()); }
/** * A sensible definition of {@link #equals(Object)} in terms of {@link #getKey()} and {@link * #getValue()}. If you override either of these methods, you may wish to override {@link * #equals(Object)} to forward to this implementation. * * @since 7.0 */ protected boolean standardEquals(@Nullable Object object) { if (object instanceof Entry) { Entry<?, ?> that = (Entry<?, ?>) object; return Objects.equal(this.getKey(), that.getKey()) && Objects.equal(this.getValue(), that.getValue()); } return false; }
/** * A sensible definition of {@link #toString} in terms of {@link #getKey} and {@link #getValue}. * If you override either of these methods, you may wish to override {@link #equals} to forward to * this implementation. * * @since 7.0 */ @Beta protected String standardToString() { return getKey() + "=" + getValue(); } }
/** * A sensible definition of {@link #hashCode()} in terms of {@link #getKey()} and {@link * #getValue()}. If you override either of these methods, you may wish to override {@link * #hashCode()} to forward to this implementation. * * @since 7.0 */ protected int standardHashCode() { K k = getKey(); V v = getValue(); return ((k == null) ? 0 : k.hashCode()) ^ ((v == null) ? 0 : v.hashCode()); }
@Override public K getKey() { assertTrue(Thread.holdsLock(mutex)); return super.getKey(); }
/** * A sensible definition of {@link #hashCode()} in terms of {@link #getKey()} and {@link * #getValue()}. If you override either of these methods, you may wish to override {@link * #hashCode()} to forward to this implementation. * * @since 7.0 */ protected int standardHashCode() { K k = getKey(); V v = getValue(); return ((k == null) ? 0 : k.hashCode()) ^ ((v == null) ? 0 : v.hashCode()); }
/** * A sensible definition of {@link #toString} in terms of {@link #getKey} and {@link #getValue}. * If you override either of these methods, you may wish to override {@link #equals} to forward to * this implementation. * * @since 7.0 */ @Beta protected String standardToString() { return getKey() + "=" + getValue(); } }
/** * A sensible definition of {@link #equals(Object)} in terms of {@link #getKey()} and {@link * #getValue()}. If you override either of these methods, you may wish to override {@link * #equals(Object)} to forward to this implementation. * * @since 7.0 */ protected boolean standardEquals(@NullableDecl Object object) { if (object instanceof Entry) { Entry<?, ?> that = (Entry<?, ?>) object; return Objects.equal(this.getKey(), that.getKey()) && Objects.equal(this.getValue(), that.getValue()); } return false; }
/** * A sensible definition of {@link #equals(Object)} in terms of {@link #getKey()} and {@link * #getValue()}. If you override either of these methods, you may wish to override {@link * #equals(Object)} to forward to this implementation. * * @since 7.0 */ protected boolean standardEquals(@NullableDecl Object object) { if (object instanceof Entry) { Entry<?, ?> that = (Entry<?, ?>) object; return Objects.equal(this.getKey(), that.getKey()) && Objects.equal(this.getValue(), that.getValue()); } return false; }
/** * A sensible definition of {@link #hashCode()} in terms of {@link #getKey()} * and {@link #getValue()}. If you override either of these methods, you may * wish to override {@link #hashCode()} to forward to this implementation. * * @since 7.0 */ protected int standardHashCode() { K k = getKey(); V v = getValue(); return ((k == null) ? 0 : k.hashCode()) ^ ((v == null) ? 0 : v.hashCode()); }
/** * A sensible definition of {@link #toString} in terms of {@link * #getKey} and {@link #getValue}. If you override either of these * methods, you may wish to override {@link #equals} to forward to this * implementation. * * @since 7.0 */ @Beta protected String standardToString() { return getKey() + "=" + getValue(); } }
/** * A sensible definition of {@link #hashCode()} in terms of {@link #getKey()} * and {@link #getValue()}. If you override either of these methods, you may * wish to override {@link #hashCode()} to forward to this implementation. * * @since 7 */ @Beta protected int standardHashCode() { K k = getKey(); V v = getValue(); return ((k == null) ? 0 : k.hashCode()) ^ ((v == null) ? 0 : v.hashCode()); }
/** * A sensible definition of {@link #toString} in terms of {@link * #getKey} and {@link #getValue}. If you override either of these * methods, you may wish to override {@link #equals} to forward to this * implementation. * * @since 7.0 */ @Beta protected String standardToString() { return getKey() + "=" + getValue(); } }
/** * A sensible definition of {@link #hashCode()} in terms of {@link #getKey()} * and {@link #getValue()}. If you override either of these methods, you may * wish to override {@link #hashCode()} to forward to this implementation. * * @since 7.0 */ @Beta protected int standardHashCode() { K k = getKey(); V v = getValue(); return ((k == null) ? 0 : k.hashCode()) ^ ((v == null) ? 0 : v.hashCode()); }
/** * A sensible definition of {@link #hashCode()} in terms of {@link #getKey()} * and {@link #getValue()}. If you override either of these methods, you may * wish to override {@link #hashCode()} to forward to this implementation. * * @since 7.0 */ protected int standardHashCode() { K k = getKey(); V v = getValue(); return ((k == null) ? 0 : k.hashCode()) ^ ((v == null) ? 0 : v.hashCode()); }
/** * A sensible definition of {@link #toString} in terms of {@link * #getKey} and {@link #getValue}. If you override either of these * methods, you may wish to override {@link #equals} to forward to this * implementation. * * @since 7.0 */ @Beta protected String standardToString() { return getKey() + "=" + getValue(); } }
/** * A sensible definition of {@link #toString} in terms of {@link * #getKey} and {@link #getValue}. If you override either of these * methods, you may wish to override {@link #equals} to forward to this * implementation. * * @since 7.0 */ @Beta protected String standardToString() { return getKey() + "=" + getValue(); } }
/** * A sensible definition of {@link #hashCode()} in terms of {@link #getKey()} and {@link * #getValue()}. If you override either of these methods, you may wish to override {@link * #hashCode()} to forward to this implementation. * * @since 7.0 */ protected int standardHashCode() { K k = getKey(); V v = getValue(); return ((k == null) ? 0 : k.hashCode()) ^ ((v == null) ? 0 : v.hashCode()); }
/** * A sensible definition of {@link #hashCode()} in terms of {@link #getKey()} * and {@link #getValue()}. If you override either of these methods, you may * wish to override {@link #hashCode()} to forward to this implementation. * * @since 7.0 */ protected int standardHashCode() { K k = getKey(); V v = getValue(); return ((k == null) ? 0 : k.hashCode()) ^ ((v == null) ? 0 : v.hashCode()); }