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-tools Show documentation
Show all versions of pkl-tools Show documentation
Fat Jar containing pkl-cli, pkl-codegen-java, pkl-codegen-kotlin, pkl-config-java, pkl-core, pkl-doc, and their shaded third-party dependencies.
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