All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.pkl.thirdparty.paguro.collections.AbstractUnmodSet Maven / Gradle / Ivy

Go to download

Fat Jar containing pkl-cli, pkl-codegen-java, pkl-codegen-kotlin, pkl-config-java, pkl-core, pkl-doc, and their shaded third-party dependencies.

There is a newer version: 0.27.1
Show newest version
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