MCPcopy Index your code
hub / github.com/grpc/grpc-java / equals

Method equals

api/src/main/java/io/grpc/Attributes.java:173–194  ·  view source on GitHub ↗

Returns true if the given object is also a Attributes with an equal attribute values. Note that if a stored values are mutable, it is possible for two objects to be considered equal at one point in time and not equal at another (due to concurrent mutation of attribute values). This m

(Object o)

Source from the content-addressed store, hash-verified

171 * @return true if the given object is a {@link Attributes} equal attributes.
172 */
173 @Override
174 public boolean equals(Object o) {
175 if (this == o) {
176 return true;
177 }
178 if (o == null || getClass() != o.getClass()) {
179 return false;
180 }
181 Attributes that = (Attributes) o;
182 if (data.size() != that.data.size()) {
183 return false;
184 }
185 for (Map.Entry<Key<?>, Object> e : data.entrySet()) {
186 if (!that.data.containsKey(e.getKey())) {
187 return false;
188 }
189 if (!Objects.equal(e.getValue(), that.data.get(e.getKey()))) {
190 return false;
191 }
192 }
193 return true;
194 }
195
196 /**
197 * Returns a hash code for the attributes.

Callers

nothing calls this directly

Calls 6

containsKeyMethod · 0.80
sizeMethod · 0.65
getMethod · 0.65
getKeyMethod · 0.45
equalMethod · 0.45
getValueMethod · 0.45

Tested by

no test coverage detected