Klasse ContainerMediator<E>

java.lang.Object
ch.nolix.core.errorcontrol.validator.ArgumentMediator<Iterable<E>>
ch.nolix.core.errorcontrol.validator.ContainerMediator<E>
Typparameter:
E - is the type of the elements of the argument of a container mediator.
Bekannte direkte Unterklassen:
ExtendedContainerMediator

public class ContainerMediator<E> extends ArgumentMediator<Iterable<E>>
A named container mediator is an argument mediator for an iterable object with a name. A named container mediator is not mutable.
Version:
2017-08-15
Autor:
Silvan Wyss
  • Felddetails

  • Konstruktordetails

    • ContainerMediator

      public ContainerMediator(Iterable<E> argument)
      Creates a new container mediator for the given argument.
      Parameter:
      argument -
  • Methodendetails

    • contains

      public void contains(Object element)
      Parameter:
      element -
      Löst aus:
      ArgumentDoesNotContainElementException - if the argument of the current ContainerMediator does not contain the given element.
    • contains

      public void contains(Predicate<E> condition)
      Parameter:
      condition -
      Löst aus:
      ArgumentIsNullException - if the given condition is null.
      ArgumentIsNullException - if the argument of this container mediator is null.
      InvalidArgumentException - if the argument of this container mediator does not contain an element that fulfills the given condition.
    • containsAll

      public void containsAll(Object[] elements)
    • containsAll

      public void containsAll(Iterable<Object> elements)
    • containsAsManyElementsAs

      public void containsAsManyElementsAs(Object[] array)
    • containsExactly

      public void containsExactly(Object firstElement, Object... elements)
    • containsExactlyEqualing

      public void containsExactlyEqualing(Object firstElement, Object... elements)
    • containsExactlyEqualing

      public void containsExactlyEqualing(Object[] elements)
    • containsExactlyInSameOrder

      public void containsExactlyInSameOrder(E element, E... elements)
    • containsOnce

      public void containsOnce(Object element)
      Parameter:
      element -
      Löst aus:
      InvalidArgumentException - if the argument of the current ContainerMediator does not contain the given element or contains the given element for several times.
    • hasElementCount

      public void hasElementCount(int elementCount)
      Parameter:
      elementCount -
      Löst aus:
      NegativeArgumentException - if the given element count is negative.
      InvalidArgumentException - if the argument of this container mediator contains less or more elements than the given element count says.
    • hasSameSizeAs

      public void hasSameSizeAs(double[] array)
      Parameter:
      array -
      Löst aus:
      ArgumentIsNullException - if the given array is null.
      InvalidArgumentException - if the argument of this container mediator contains less or more elements than the given array.
    • isEmpty

      public void isEmpty()
      Löst aus:
      ArgumentIsNullException - if the argument of this container mediator is null.
      NonEmptyArgumentException - if the argument of this container mediator is empty.
    • isNotEmpty

      public void isNotEmpty()
      Löst aus:
      ArgumentIsNullException - if the argument of this container mediator is null.
      EmptyArgumentException - if the argument of this container mediator is empty.
    • getArgumentName

      protected final String getArgumentName()
      Gibt zurück:
      the argument name of the current Mediator.