org.klojang.collections.ImmutableSet Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of klojang-collections Show documentation
Show all versions of klojang-collections Show documentation
Non-trivial additions to the Java Collections Framework
package org.klojang.collections;
import java.util.Collection;
import java.util.Set;
import java.util.function.Predicate;
abstract sealed class ImmutableSet implements Set permits ArraySet,
AbstractTypeSet {
@Override
public boolean add(E e) {
throw new UnsupportedOperationException();
}
@Override
public boolean remove(Object o) {
throw new UnsupportedOperationException();
}
@Override
public boolean addAll(Collection extends E> c) {
throw new UnsupportedOperationException();
}
@Override
public boolean retainAll(Collection> c) {
throw new UnsupportedOperationException();
}
@Override
public boolean removeAll(Collection> c) {
throw new UnsupportedOperationException();
}
@Override
public void clear() {
throw new UnsupportedOperationException();
}
@Override
public boolean removeIf(Predicate super E> filter) {
throw new UnsupportedOperationException();
}
}