Class AbstractIterableMediator<E>
java.lang.Object
ch.nolix.base.validation.base.AbstractMediator
ch.nolix.base.validation.object.AbstractObjectMediator<Iterable<E>>
ch.nolix.base.validation.object.AbstractIterableMediator<E>
- Type Parameters:
E- is the type of the elements of the argument of aAbstractIterableMediator.
- Direct Known Subclasses:
IterableMediator, NamableIterableMediator
- Author:
- Silvan Wyss
-
Field Summary
Fields inherited from class AbstractMediator
DEFAULT_ARGUMENT_NAME -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidvoidcontainsAll(Iterable<Object> elements) voidcontainsAll(Object[] elements) voidcontainsAsManyElementsAs(Iterable<?> iterable) voidcontainsAsManyElementsAs(Object[] array) voidvoidcontainsEqualing(Object object) voidcontainsExactly(Object... elements) voidcontainsExactlyEqualing(Object... elements) voidcontainsExactlyInSameOrder(E... elements) voidcontainsExactlyInSameOrder(Iterable<E> elements) voidcontainsExactlyOneWithStringRepresentation(String stringRepresentation) voidcontainsOnce(Object element) voidhasElementCount(int elementCount) voidhasSameSizeAs(double[] array) voidisEmpty()voidMethods inherited from class AbstractObjectMediator
fulfills, hasSameStringRepresentationAs, hasStringRepresentation, is, isEqualTo, isNot, isNotEqualTo, isNotNull, isNull, isOfType
-
Method Details
-
contains
-
contains
-
containsAll
-
containsAll
-
containsAsManyElementsAs
-
containsAsManyElementsAs
-
containsDistinctNonNullElemensOnly
public void containsDistinctNonNullElemensOnly() -
containsEqualing
-
containsExactly
-
containsExactlyEqualing
-
containsExactlyInSameOrder
-
containsExactlyInSameOrder
-
containsExactlyOneWithStringRepresentation
- Parameters:
stringRepresentation-- Throws:
RuntimeException- if the argument of the currentIterableMediatordoes not contain an element with the given stringRepresentation.
-
containsOnce
- Parameters:
element-- Throws:
RuntimeException- if the argument of the currentIterableMediatordoes not contain the given element or contains the given element for several times.
-
hasElementCount
public void hasElementCount(int elementCount) - Parameters:
elementCount-- Throws:
RuntimeException- if the given element count is negative.RuntimeException- if the argument of this container mediator contains less or more elements than the given element count says.
-
hasSameSizeAs
public void hasSameSizeAs(double[] array) - Parameters:
array-- Throws:
RuntimeException- if the given array is null.RuntimeException- if the argument of this container mediator contains less or more elements than the given array.
-
isEmpty
public void isEmpty()- Throws:
RuntimeException- if the argument of this container mediator is null.NonEmptyArgumentException- if the argument of this container mediator is empty.
-
isNotEmpty
public void isNotEmpty()- Throws:
RuntimeException- if the argument of this container mediator is null.RuntimeException- if the argument of this container mediator is empty.
-