public boolean equals(Object anObject) {
    if (this == anObject) {
      return true;
    }
    if (anObject instanceof PdxString) {
      PdxString o = (PdxString) anObject;
      if (header != o.header) { // header needs to be same for Pdxstrings to be equal
        return false;
      }
      int n = getLength();
      if (n == o.getLength()) {
        int i = offset;
        int j = o.offset;
        while (n-- != 0) {
          if (bytes[i++] != o.bytes[j++]) {
            return false;
          }
        }
        return true;
      }
    }
    return false;
  }
A class that references the String offset in PdxInstance Used as Index keys for PdxInstances and
query evaluation for PdxInstances

@since GemFire 7.0
geode-core/src/main/java/org/apache/geode/pdx/internal/PdxString.java