MCPcopy
hub / github.com/google/gson / contains

Method contains

src/main/java/com/google/gson/MemoryRefStack.java:75–87  ·  view source on GitHub ↗

Performs a memory reference check to see it the obj exists in the stack. @param obj the object to search for in the stack @return true if this object is already in the stack otherwise false

(ObjectTypePair obj)

Source from the content-addressed store, hash-verified

73 * @return true if this object is already in the stack otherwise false
74 */
75 public boolean contains(ObjectTypePair obj) {
76 if (obj == null) {
77 return false;
78 }
79
80 for (ObjectTypePair stackObject : stack) {
81 if (stackObject.getObject() == obj.getObject()
82 && stackObject.type.equals(obj.type) ) {
83 return true;
84 }
85 }
86 return false;
87 }
88}

Calls 2

getObjectMethod · 0.80
equalsMethod · 0.45