Class Validator


  • public final class Validator
    extends java.lang.Object
    The validator provides functions to validate arguments. Methods are called on objects, functions are called independently. Of this class an instance cannot be created.
    Author:
    Silvan Wyss
    • Method Detail

      • assertThat

        public static <A> ExtendedArgumentMediator<A> assertThat​(A argument)
        Type Parameters:
        A - is the type of the given argument.
        Parameters:
        argument -
        Returns:
        a new argument mediator for given argument.
      • assertThat

        public static <A> ExtendedContainerMediator<A> assertThat​(A[] argument)
        Type Parameters:
        A - is the type of the elements of the given argument.
        Parameters:
        argument -
        Returns:
        a new extended container mediator for the given argument.
      • assertThat

        public static <T> ExtendedTypeMediator<T> assertThat​(java.lang.Class<T> argument)
        Type Parameters:
        T - is the type of the given argument
        Parameters:
        argument -
        Returns:
        a new ExtendedTypeMediator for the given argument.
      • assertThat

        public static ExtendedDoubleMediator assertThat​(double argument)
        Parameters:
        argument -
        Returns:
        a new extended double mediator for the given argument.
      • assertThat

        public static ExtendedContainerMediator<java.lang.Double> assertThat​(double[] argument)
        Parameters:
        argument -
        Returns:
        a new extended container mediator for the given argument.
      • assertThat

        public static ExtendedLongMediator assertThat​(int argument)
        Parameters:
        argument -
        Returns:
        a new extended long mediator for the given argument.
      • assertThat

        public static ExtendedContainerMediator<java.lang.Long> assertThat​(int[] argument)
        Parameters:
        argument -
        Returns:
        a new extended container mediator for the given argument.
      • assertThat

        public static <A> ExtendedContainerMediator<A> assertThat​(java.lang.Iterable<A> argument)
        Type Parameters:
        A - is the type of the elements of the given argument.
        Parameters:
        argument -
        Returns:
        a new extended container mediator for the given argument.
      • assertThat

        public static ExtendedLongMediator assertThat​(long argument)
        Parameters:
        argument -
        Returns:
        a new extended long mediator for the given argument.
      • assertThat

        public static ExtendedContainerMediator<java.lang.Long> assertThat​(long[] argument)
        Parameters:
        argument -
        Returns:
        a new extended container mediator for the given argument.
      • assertThat

        public static ExtendedStringMediator assertThat​(java.lang.String argument)
        Parameters:
        argument -
        Returns:
        a new extended string mediator for the given argument.
      • assertThat

        public static ExtendedContainerMediator<java.lang.String> assertThat​(java.lang.String[] argument)
        Parameters:
        argument -
        Returns:
        a new extended container mediator for the given argument.
      • assertThatTheDoubles

        public static MultiDoubleMediator assertThatTheDoubles​(double... arguments)
        Parameters:
        arguments -
        Returns:
        a new multi double mediator for the given arguments.
        Throws:
        ArgumentIsNullException - if the given arguments is null.
      • assertThatTheDoubles

        public static MultiDoubleMediator assertThatTheDoubles​(java.lang.Iterable<java.lang.Double> arguments)
        Parameters:
        arguments -
        Returns:
        a new multi double mediator for the given arguments.
        Throws:
        ArgumentIsNullException - if the given arguments is null.
      • assertThatTheElements

        public static <E> MultiArgumentMediator<E> assertThatTheElements​(E[] arguments)
        Type Parameters:
        E - is the type of the given arguments.
        Parameters:
        arguments -
        Returns:
        a new multi argument mediator for the given arguments.
        Throws:
        ArgumentIsNullException - if the given arguments is null.
      • assertThatTheElements

        public static <E> MultiArgumentMediator<E> assertThatTheElements​(java.lang.Iterable<E> arguments)
        Type Parameters:
        E - is the type of the given arguments.
        Parameters:
        arguments -
        Returns:
        a new multi argument mediator for the given arguments.
        Throws:
        ArgumentIsNullException - if the given arguments is null.
      • assertThatTheLongs

        public static MultiLongMediator assertThatTheLongs​(long... arguments)
        Parameters:
        arguments -
        Returns:
        a new multi long mediator for the given arguments.
        Throws:
        ArgumentIsNullException - if the given arguments is null.
      • assertThatTheLongs

        public static MultiLongMediator assertThatTheLongs​(java.lang.Iterable<java.lang.Long> arguments)
        Parameters:
        arguments -
        Returns:
        a new multi long mediator for the given arguments.
        Throws:
        ArgumentIsNullException - if the given arguments is null.
      • assertThatTheStrings

        public static MultiStringMediator assertThatTheStrings​(java.lang.String... arguments)
        Parameters:
        arguments -
        Returns:
        a new multi string mediator for the given arguments.
        Throws:
        ArgumentIsNullException - if the given arguments is null.
      • assertThatTheStrings

        public static MultiStringMediator assertThatTheStrings​(java.lang.Iterable<java.lang.String> arguments)
        Parameters:
        arguments -
        Returns:
        a new string container mediator for the given arguments.
        Throws:
        ArgumentIsNullException - if the given arguments is null.