Class ObjectSet<O extends ObjectType>
java.lang.Object
com.evolveum.midpoint.schema.util.ObjectSet<O>
- All Implemented Interfaces:
Iterable<O>,Collection<O>
This is a set of objects that considers objects being equal by simply comparing their OIDs.
It should be more efficient and robust than e.g.
HashSet that uses AbstractMutableObjectable.hashCode() and
ObjectType.equals(Object) methods.
We intentionally do not implement Set interface, because we do not fulfill its contract.
Requirement: only objects with OID can be stored here.
TODO better name-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanaddAll(@NotNull Collection<? extends O> c) asList()voidclear()booleanbooleancontainsAll(@NotNull Collection<?> c) booleancontainsOid(String oid) booleanisEmpty()iterator()static <O extends ObjectType>
ObjectSet<O>of(O... objects) booleanbooleanremoveAll(@NotNull Collection<?> c) booleanretainAll(@NotNull Collection<?> c) intsize()@NotNull Object[]toArray()<T> @NotNull T[]toArray(@NotNull T[] a) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface java.util.Collection
equals, hashCode, parallelStream, removeIf, spliterator, stream, toArray
-
Constructor Details
-
ObjectSet
public ObjectSet() -
ObjectSet
-
-
Method Details
-
of
-
size
public int size()- Specified by:
sizein interfaceCollection<O extends ObjectType>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceCollection<O extends ObjectType>
-
contains
- Specified by:
containsin interfaceCollection<O extends ObjectType>
-
iterator
- Specified by:
iteratorin interfaceCollection<O extends ObjectType>- Specified by:
iteratorin interfaceIterable<O extends ObjectType>
-
toArray
- Specified by:
toArrayin interfaceCollection<O extends ObjectType>
-
toArray
@NotNull public <T> @NotNull T[] toArray(@NotNull @NotNull T[] a) - Specified by:
toArrayin interfaceCollection<O extends ObjectType>
-
add
- Specified by:
addin interfaceCollection<O extends ObjectType>
-
remove
- Specified by:
removein interfaceCollection<O extends ObjectType>
-
containsAll
- Specified by:
containsAllin interfaceCollection<O extends ObjectType>
-
addAll
- Specified by:
addAllin interfaceCollection<O extends ObjectType>
-
removeAll
- Specified by:
removeAllin interfaceCollection<O extends ObjectType>
-
retainAll
- Specified by:
retainAllin interfaceCollection<O extends ObjectType>
-
clear
public void clear()- Specified by:
clearin interfaceCollection<O extends ObjectType>
-
asList
-
containsOid
-
get
-