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 StringPerforms 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:IterableChecksPerforms checks on the length of the iterable.- Specified by:
hasLengthin interfaceIterableChecks<E>- Parameters:
lengthChecks- The checks to perform- Throws:
InvalidObjectException
-
hasLength
- Specified by:
hasLengthin interfaceIterableChecks<E>- Throws:
InvalidObjectException
-
isNotEmpty
Description copied from interface:IterableChecksChecks that the iterable is not empty.- Specified by:
isNotEmptyin interfaceIterableChecks<E>- Throws:
InvalidCollectionException
-
self
- Specified by:
selfin classChecksBase<Collection<E>,CollectionChecks<E>>
-
getDefaultName
- Specified by:
getDefaultNamein classChecksBase<Collection<E>,CollectionChecks<E>>
-