org.pkl.thirdparty.paguro.collections.AbstractUnmodSet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of pkl-config-java-all Show documentation
Show all versions of pkl-config-java-all Show documentation
Shaded fat Jar for pkl-config-java, a Java config library based on the Pkl config language.
package org.pkl.thirdparty.paguro.collections;
import java.util.Set;
/**
Implements equals and hashCode() methods compatible with java.util.Set (which ignores order)
to make defining unmod sets easier, especially for implementing Map.keySet() and such.
*/
public abstract class AbstractUnmodSet extends AbstractUnmodIterable implements UnmodSet {
@Override public boolean equals(Object other) {
if (this == other) { return true; }
if ( !(other instanceof Set) ) { return false; }
Set that = (Set) other;
return (size() == that.size()) &&
containsAll(that);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy