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
,CHolidayCollection
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 Instance Methods Concrete Methods Modifier and Type Method Description boolean
_useWaiter()
boolean
contains(java.lang.Object o)
Returnstrue
if this collection contains the specified element.boolean
equals(java.lang.Object c)
Returnstrue
if this collection equals the specified collection.void
forEach(java.util.function.Consumer<? super E> action)
Performs the given action for each element of theIterable
until all elements have been processed or the action throws an exception.CCollection<E>
getBaseValue()
get theCollection
of itemsboolean
removeIf(java.util.function.Predicate<? super E> filter)
Removes all of the elements of this collection that satisfy the given predicate.CSet<E>
set(java.util.Collection<? extends E> items)
java.util.stream.Stream<E>
stream()
Returns CCliItemCollection sequentialStream
with this collection as its source.java.lang.String
toString()
-
Methods inherited from class java.util.HashSet
add, clear, clone, 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, _verifyWithDefaultMessage, _verifyWithDefaultMessage, getDefaultMessage, getEntityDescription
-
Methods inherited from interface org.catools.common.extensions.wait.interfaces.CBaseWaiter
getDefaultWaitInSeconds, getDefaultWaitIntervalInMilliSeconds
-
Methods inherited from interface org.catools.common.collections.interfaces.CCollection
add, addAll, addIf, clear, containsAll, getAll, getAny, getAnyAndRemove, getFirst, getFirst, getFirstOrElse, getFirstOrElse, getFirstOrNull, getFirstOrNull, getFirstOrThrow, getFirstOrThrow, has, hasNot, isEmpty, isNotEmpty, iterator, join, join, join, map, mapToList, mapToSet, partition, remove, removeAll, retainAll, size, spliterator, toArray, toArray, toList, toSet
-
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.extensions.states.interfaces.CIterableState
containsAll, containsNone, containsNone, emptyOrContains, emptyOrNotContains, isEqual, isEqual, 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, 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
-
contains
public boolean contains(java.lang.Object o)
Description copied from interface:CCollection
Returnstrue
if this collection contains the specified element. More formally, returnstrue
if and only if this collection contains at least one elemente
such thatObjects.equals(o, e)
.- Specified by:
contains
in interfaceCCollection<E>
- Specified by:
contains
in interfaceCIterableState<E>
- Specified by:
contains
in interfacejava.util.Collection<E>
- Specified by:
contains
in interfacejava.util.Set<E>
- Overrides:
contains
in classjava.util.HashSet<E>
- Parameters:
o
- element whose presence in this collection is to be tested- Returns:
true
if this collection contains the specified element
-
equals
public boolean equals(java.lang.Object c)
Description copied from interface:CCollection
Returnstrue
if this collection equals the specified collection.- Specified by:
equals
in interfaceCCollection<E>
- 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:
CCollection.contains(Object)
-
forEach
public void forEach(java.util.function.Consumer<? super E> action)
Description copied from interface:CCollection
Performs the given action for each element of theIterable
until all elements have been processed or the action throws an exception. Actions are performed in the order of iteration, if that order is specified. Exceptions thrown by the action are relayed to the caller.The behavior of this method is unspecified if the action performs side-effects that modify the underlying source of elements, unless an overriding class has specified CCliItemCollection concurrent modification policy.
-
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
- CCliItemCollection 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 CCliItemCollection sequentialStream
with this collection as its source.This method should be overridden when the
CCollection.spliterator()
method cannot return CCliItemCollection spliterator that isIMMUTABLE
,CONCURRENT
, or late-binding. (SeeCCollection.spliterator()
for details.)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.util.AbstractCollection<E>
-
_useWaiter
public boolean _useWaiter()
- Specified by:
_useWaiter
in interfaceCBaseVerifier<E>
-
-