@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof ClusterStatus)) { return false; } ClusterStatus other = (ClusterStatus) o; return Objects.equal(getHBaseVersion(), other.getHBaseVersion()) && Objects.equal(getLiveServerLoads(), other.getLiveServerLoads()) && getDeadServerNames().containsAll(other.getDeadServerNames()) && Arrays.equals(getMasterCoprocessors(), other.getMasterCoprocessors()) && Objects.equal(getMaster(), other.getMaster()) && getBackupMasters().containsAll(other.getBackupMasters()) && Objects.equal(getClusterId(), other.getClusterId()) && getMasterInfoPort() == other.getMasterInfoPort(); }
private boolean isEqual(RegionLocations locs1, RegionLocations locs2) { HRegionLocation[] locArr1 = locs1.getRegionLocations(); HRegionLocation[] locArr2 = locs2.getRegionLocations(); if (locArr1.length != locArr2.length) { return false; } for (int i = 0; i < locArr1.length; i++) { // do not need to compare region info HRegionLocation loc1 = locArr1[i]; HRegionLocation loc2 = locArr2[i]; if (loc1 == null) { if (loc2 != null) { return false; } } else { if (loc2 == null) { return false; } if (loc1.getSeqNum() != loc2.getSeqNum()) { return false; } if (Objects.equal(loc1.getServerName(), loc2.getServerName())) { return false; } } } return true; }
@Override public boolean equals(Object o) { if (this == o) { return true; } if (!(o instanceof ClusterStatus)) { return false; } ClusterStatus other = (ClusterStatus) o; return Objects.equal(getHBaseVersion(), other.getHBaseVersion()) && Objects.equal(getLiveServerLoads(), other.getLiveServerLoads()) && getDeadServerNames().containsAll(other.getDeadServerNames()) && Arrays.equals(getMasterCoprocessors(), other.getMasterCoprocessors()) && Objects.equal(getMaster(), other.getMaster()) && getBackupMasters().containsAll(other.getBackupMasters()) && Objects.equal(getClusterId(), other.getClusterId()) && getMasterInfoPort() == other.getMasterInfoPort(); }
@Override public boolean containsValue(@Nullable Object value) { for (V[] row : array) { for (V element : row) { if (Objects.equal(value, element)) { return true; } } } return false; }
private BiEntry<K, V> seekByKey(@Nullable Object key, int keyHash) { for (BiEntry<K, V> entry = hashTableKToV[keyHash & mask]; entry != null; entry = entry.nextInKToVBucket) { if (keyHash == entry.keyHash && Objects.equal(key, entry.key)) { return entry; } } return null; }
private BiEntry<K, V> seekByValue(@Nullable Object value, int valueHash) { for (BiEntry<K, V> entry = hashTableVToK[valueHash & mask]; entry != null; entry = entry.nextInVToKBucket) { if (valueHash == entry.valueHash && Objects.equal(value, entry.value)) { return entry; } } return null; }
@Override public boolean equals(@Nullable Object other) { if (this == other) { return true; } if (other instanceof HostAndPort) { HostAndPort that = (HostAndPort) other; return Objects.equal(this.host, that.host) && this.port == that.port && this.hasBracketlessColons == that.hasBracketlessColons; } return false; }
@Override public boolean equals(@Nullable 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; }
/** * @deprecated Use {@link Network#equals(Object)} instead. This method will be removed in late * 2017. */ // TODO(user): Delete this method. @Deprecated public static boolean equivalent( @Nullable Network<?, ?> networkA, @Nullable Network<?, ?> networkB) { return Objects.equal(networkA, networkB); }
@Override public boolean equals(@Nullable Object o) { if (o instanceof ForMapWithDefault) { ForMapWithDefault<?, ?> that = (ForMapWithDefault<?, ?>) o; return map.equals(that.map) && Objects.equal(defaultValue, that.defaultValue); } return false; }
/** * @deprecated Use {@link ValueGraph#equals(Object)} instead. This method will be removed in late * 2017. */ // TODO(user): Delete this method. @Deprecated public static boolean equivalent( @Nullable ValueGraph<?, ?> graphA, @Nullable ValueGraph<?, ?> graphB) { return Objects.equal(graphA, graphB); }
@Override public boolean equals(Object obj) { if (obj instanceof GenericArrayType) { GenericArrayType that = (GenericArrayType) obj; return Objects.equal(getGenericComponentType(), that.getGenericComponentType()); } return false; }
@Override public boolean equals(@Nullable Object other) { if (other instanceof StandardBaseEncoding) { StandardBaseEncoding that = (StandardBaseEncoding) other; return this.alphabet.equals(that.alphabet) && Objects.equal(this.paddingChar, that.paddingChar); } return false; }
@Override public boolean equals(@Nullable Object object) { if (object instanceof MapDifference.ValueDifference) { MapDifference.ValueDifference<?> that = (MapDifference.ValueDifference<?>) object; return Objects.equal(this.left, that.leftValue()) && Objects.equal(this.right, that.rightValue()); } return false; }
@Override public boolean equals(Object other) { if (!(other instanceof ParameterizedType)) { return false; } ParameterizedType that = (ParameterizedType) other; return getRawType().equals(that.getRawType()) && Objects.equal(getOwnerType(), that.getOwnerType()) && Arrays.equals(getActualTypeArguments(), that.getActualTypeArguments()); }
@Override public boolean contains(Object o) { if (o instanceof Entry) { Entry<?, ?> entry = (Entry<?, ?>) o; Object key = entry.getKey(); V value = Maps.safeGet(map(), key); return Objects.equal(value, entry.getValue()) && (value != null || map().containsKey(key)); } return false; }
/** * Indicates whether an object equals this entry, following the behavior * specified in {@link Multiset.Entry#equals}. */ @Override public boolean equals(@Nullable Object object) { if (object instanceof Multiset.Entry) { Multiset.Entry<?> that = (Multiset.Entry<?>) object; return this.getCount() == that.getCount() && Objects.equal(this.getElement(), that.getElement()); } return false; }
@Override public boolean equals(@Nullable Object obj) { if (obj instanceof ContainsPatternPredicate) { ContainsPatternPredicate that = (ContainsPatternPredicate) obj; // Pattern uses Object (identity) equality, so we have to reach // inside to compare individual fields. return Objects.equal(pattern.pattern(), that.pattern.pattern()) && pattern.flags() == that.pattern.flags(); } return false; }