Class CollectionChecks<E>
java.lang.Object
dev.prozilla.pine.common.util.checks.ChecksBase<Collection<E>,CollectionChecks<E>>
dev.prozilla.pine.common.util.checks.CollectionChecks<E>
- All Implemented Interfaces:
IterableChecks<CollectionChecks<E>>
public final class CollectionChecks<E>
extends ChecksBase<Collection<E>,CollectionChecks<E>>
implements IterableChecks<CollectionChecks<E>>
Utility class for performing checks on collections.
-
Field Summary
Fields inherited from class dev.prozilla.pine.common.util.checks.ChecksBase
name, value
-
Constructor Summary
ConstructorsConstructorDescriptionCollectionChecks
(Collection<E> value) CollectionChecks
(Collection<E> value, String name) -
Method Summary
Modifier and TypeMethodDescriptionprotected String
Performs checks on the length of the iterable.Checks that the iterable is not empty.protected CollectionChecks
<E> self()
Methods inherited from class dev.prozilla.pine.common.util.checks.ChecksBase
asString, get, isEqualTo, isNotEqualTo, isNotNull, named
-
Constructor Details
-
CollectionChecks
-
CollectionChecks
-
-
Method Details
-
hasLength
public CollectionChecks<E> hasLength(Consumer<IntChecks> lengthChecks) throws InvalidObjectException Description copied from interface:IterableChecks
Performs checks on the length of the iterable.- Specified by:
hasLength
in interfaceIterableChecks<E>
- Parameters:
lengthChecks
- The checks to perform- Throws:
InvalidObjectException
-
hasLength
- Specified by:
hasLength
in interfaceIterableChecks<E>
- Throws:
InvalidObjectException
-
isNotEmpty
Description copied from interface:IterableChecks
Checks that the iterable is not empty.- Specified by:
isNotEmpty
in interfaceIterableChecks<E>
- Throws:
InvalidCollectionException
-
self
- Specified by:
self
in classChecksBase<Collection<E>,
CollectionChecks<E>>
-
getDefaultName
- Specified by:
getDefaultName
in classChecksBase<Collection<E>,
CollectionChecks<E>>
-