Package org.catools.common.collections
Class CSet<E>
- java.lang.Object
-
- java.util.AbstractCollection<E>
-
- java.util.AbstractSet<E>
-
- java.util.HashSet<E>
-
- org.catools.common.collections.CSet<E>
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,java.lang.Iterable<E>
,java.util.Collection<E>
,java.util.Set<E>
,CCollection<E>
,CIterable<E>
,CBaseState<java.lang.Iterable<E>>
,CCollectionState<E>
,CIterableState<E>
,CObjectState<java.lang.Iterable<E>>
,CBaseVerifier<java.lang.Iterable<E>>
,CCollectionVerifier<E>
,CIterableVerifier<E>
,CObjectVerifier<java.lang.Iterable<E>,CIterableState<E>>
,CBaseWaiter<java.lang.Iterable<E>>
- Direct Known Subclasses:
CConfigInfoCollection
public class CSet<E> extends java.util.HashSet<E> implements CCollection<E>, java.util.Set<E>
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.catools.common.extensions.states.interfaces.CBaseState
serialVersionUID
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
_useWaiter()
boolean
equals(java.lang.Object c)
Returnstrue
if this collection equals the specified collection.CCollection<E>
getBaseValue()
get theCollection
of itemsstatic <C> CSet<C>
of(C... c)
static <C> CSet<C>
of(java.lang.Iterable<C> iterable)
static <C> CSet<C>
of(java.util.stream.Stream<C> stream)
boolean
removeIf(java.util.function.Predicate<? super E> filter)
Removes all of the elements of this collection that satisfy the given predicate.java.util.stream.Stream<E>
stream()
Returns sequentialStream
with this collection as its source.java.lang.String
toString()
-
Methods inherited from class java.util.HashSet
add, clear, clone, contains, isEmpty, iterator, remove, size, spliterator
-
Methods inherited from class java.util.AbstractCollection
addAll, containsAll, retainAll, toArray, toArray
-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.catools.common.extensions.verify.interfaces.CBaseVerifier
_verify, _verify, _verify, _verify, _verify, _verify, _verify, _verify, _verify, getDefaultMessage, getDefaultMessage, getVerifyMessagePrefix
-
Methods inherited from interface org.catools.common.extensions.wait.interfaces.CBaseWaiter
getDefaultWaitInSeconds, getDefaultWaitIntervalInMilliSeconds
-
Methods inherited from interface org.catools.common.collections.interfaces.CCollection
addIf, contains, getAnyAndRemove, isEmpty, partition, spliterator, toMap, toMap, toMap
-
Methods inherited from interface org.catools.common.extensions.states.interfaces.CCollectionState
sizeEquals, sizeIsGreaterThan, sizeIsLessThan
-
Methods inherited from interface org.catools.common.extensions.verify.interfaces.CCollectionVerifier
_toState, verifySizeEquals, verifySizeEquals, verifySizeIsGreaterThan, verifySizeIsGreaterThan, verifySizeIsLessThan, verifySizeIsLessThan
-
Methods inherited from interface org.catools.common.collections.interfaces.CIterable
getAll, getAny, getDisjunction, getFirst, getFirst, getFirstOrAny, getFirstOrElse, getFirstOrElse, getFirstOrElse, getFirstOrElseGet, getFirstOrElseGet, getFirstOrNull, getFirstOrNull, getFirstOrThrow, getFirstOrThrow, getIntersection, getUnion, has, hasNot, join, join, join, map, mapToList, mapToSet, toList, toSet
-
Methods inherited from interface org.catools.common.extensions.states.interfaces.CIterableState
containsAll, containsAny, containsNone, containsNone, emptyOrContains, emptyOrNotContains, isEqual, isEqual, isNotEmpty, notContains, notContainsAll, notContainsAll
-
Methods inherited from interface org.catools.common.extensions.verify.interfaces.CIterableVerifier
verifyContains, verifyContains, verifyContainsAll, verifyContainsAll, verifyContainsNone, verifyContainsNone, verifyEmptyOrContains, verifyEmptyOrContains, verifyEmptyOrNotContains, verifyEmptyOrNotContains, verifyEquals, verifyEquals, verifyHas, verifyHas, verifyHasNot, verifyHasNot, verifyIsEmpty, verifyIsEmpty, verifyIsNotEmpty, verifyIsNotEmpty, verifyNotContains, verifyNotContains, verifyNotContainsAll, verifyNotContainsAll
-
Methods inherited from interface org.catools.common.extensions.states.interfaces.CObjectState
equalsAny, equalsAny, equalsNone, equalsNone, isNotNull, isNull, notEqual, test
-
Methods inherited from interface org.catools.common.extensions.verify.interfaces.CObjectVerifier
verifyEqualsAny, verifyEqualsAny, verifyEqualsNone, verifyEqualsNone, verifyIsNotNull, verifyIsNotNull, verifyIsNull, verifyIsNull, verifyNotEquals, verifyNotEquals
-
-
-
-
Method Detail
-
of
public static <C> CSet<C> of(C... c)
-
of
public static <C> CSet<C> of(java.util.stream.Stream<C> stream)
-
of
public static <C> CSet<C> of(java.lang.Iterable<C> iterable)
-
getBaseValue
public CCollection<E> getBaseValue()
get theCollection
of items- Specified by:
getBaseValue
in interfaceCBaseState<E>
- Specified by:
getBaseValue
in interfaceCCollection<E>
- Returns:
- the collection of items to be used in interface
-
removeIf
public boolean removeIf(java.util.function.Predicate<? super E> filter)
Description copied from interface:CCollection
Removes all of the elements of this collection that satisfy the given predicate. Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller.- Specified by:
removeIf
in interfaceCCollection<E>
- Specified by:
removeIf
in interfacejava.util.Collection<E>
- Parameters:
filter
- predicate which returnstrue
for elements to be removed- Returns:
true
if any elements were removed
-
stream
public java.util.stream.Stream<E> stream()
Description copied from interface:CCollection
Returns sequentialStream
with this collection as its source.This method should be overridden when the
CCollection.spliterator()
method cannot return spliterator that isIMMUTABLE
,CONCURRENT
, or late-binding. (SeeCCollection.spliterator()
for details.)
-
equals
public boolean equals(java.lang.Object c)
Description copied from interface:CIterable
Returnstrue
if this collection equals the specified collection.- Specified by:
equals
in interfaceCIterable<E>
- Specified by:
equals
in interfacejava.util.Collection<E>
- Specified by:
equals
in interfacejava.util.Set<E>
- Overrides:
equals
in classjava.util.AbstractSet<E>
- Parameters:
c
- collection to be checked for equality- Returns:
true
if this collection contains none of the elements in the specified collection- See Also:
CIterableState.contains(Object)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.util.AbstractCollection<E>
-
_useWaiter
public boolean _useWaiter()
- Specified by:
_useWaiter
in interfaceCBaseVerifier<E>
-
-