/** * Determine if the GTIDs represented by this object are contained completely within the supplied set of GTIDs. * Note that if two {@link GtidSet}s are equal, then they both are subsets of the other. * @param other the other set of GTIDs; may be null * @return {@code true} if all of the GTIDs in this set are equal to or completely contained within the supplied * set of GTIDs, or {@code false} otherwise */ public boolean isContainedWithin(GtidSet other) { if (other == null) { return false; } if (this == other) { return true; } if (this.equals(other)) { return true; } for (UUIDSet uuidSet : map.values()) { UUIDSet thatSet = other.getUUIDSet(uuidSet.getUUID()); if (!uuidSet.isContainedWithin(thatSet)) { return false; } } return true; }