Class ArgumentSets


  • public class ArgumentSets
    extends java.lang.Object
    Class for defining sets to a CartesianTest execution with arguments for each parameter in the order in which they appear in the test method.

    Use the static factory method argumentsForFirstParameter to create an instance and call argumentsForNextParameter for each parameter after the first. Alternatively, call the static factory method create to create an instance call argumentsForNextParameter for each parameter.

    • Field Summary

      Fields 
      Modifier and Type Field Description
      private java.util.List<java.util.List<?>> arguments  
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ArgumentSets()  
      private ArgumentSets​(java.util.Collection<?> arguments)  
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      private ArgumentSets add​(java.util.Collection<?> arguments)  
      static <T> ArgumentSets argumentsForFirstParameter​(java.util.Collection<T> arguments)
      Creates a single set of distinct objects (according to their equals) for the first parameter of a CartesianTest from the elements of the passed Collection.
      static <T> ArgumentSets argumentsForFirstParameter​(java.util.stream.Stream<T> arguments)
      Creates a single set of distinct objects (according to their equals) for the first parameter of a CartesianTest from the elements of the passed Stream.
      static <T> ArgumentSets argumentsForFirstParameter​(T... arguments)
      Creates a single set of distinct objects (according to their equals) for the first parameter of a CartesianTest from the elements of the passed objects.
      <T> ArgumentSets argumentsForNextParameter​(java.util.Collection<T> arguments)
      Creates a single set of distinct objects (according to their equals) for the next parameter of a CartesianTest from the elements of the passed Collection.
      <T> ArgumentSets argumentsForNextParameter​(java.util.stream.Stream<T> arguments)
      Creates a single set of distinct objects (according to their equals) for the next parameter of a CartesianTest from the elements of the passed Stream.
      <T> ArgumentSets argumentsForNextParameter​(T... arguments)
      Creates a single set of distinct objects (according to their equals) for the next parameter of a CartesianTest from the elements of the passed objects.
      static ArgumentSets create()
      Creates a new ArgumentSets without arguments for any parameters.
      (package private) java.util.List<java.util.List<?>> getArguments()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • arguments

        private final java.util.List<java.util.List<?>> arguments
    • Constructor Detail

      • ArgumentSets

        private ArgumentSets()
      • ArgumentSets

        private ArgumentSets​(java.util.Collection<?> arguments)
    • Method Detail

      • add

        private ArgumentSets add​(java.util.Collection<?> arguments)
      • argumentsForFirstParameter

        public static <T> ArgumentSets argumentsForFirstParameter​(java.util.Collection<T> arguments)
        Creates a single set of distinct objects (according to their equals) for the first parameter of a CartesianTest from the elements of the passed Collection.

        The passed argument does not have to be an instance of Set.

        Parameters:
        arguments - the objects that should be passed to the parameter
        Returns:
        a new ArgumentSets object
      • argumentsForFirstParameter

        @SafeVarargs
        public static <T> ArgumentSets argumentsForFirstParameter​(T... arguments)
        Creates a single set of distinct objects (according to their equals) for the first parameter of a CartesianTest from the elements of the passed objects.
        Parameters:
        arguments - the objects that should be passed to the parameter
        Returns:
        a new ArgumentSets object
      • argumentsForFirstParameter

        public static <T> ArgumentSets argumentsForFirstParameter​(java.util.stream.Stream<T> arguments)
        Creates a single set of distinct objects (according to their equals) for the first parameter of a CartesianTest from the elements of the passed Stream.
        Parameters:
        arguments - the objects that should be passed to the parameter
        Returns:
        a new ArgumentSets object
      • argumentsForNextParameter

        public final <T> ArgumentSets argumentsForNextParameter​(java.util.Collection<T> arguments)
        Creates a single set of distinct objects (according to their equals) for the next parameter of a CartesianTest from the elements of the passed Collection.

        The passed argument does not have to be an instance of Set.

        Parameters:
        arguments - the objects that should be passed to the parameter
        Returns:
        this ArgumentSets object, for fluent set definitions
      • argumentsForNextParameter

        @SafeVarargs
        public final <T> ArgumentSets argumentsForNextParameter​(T... arguments)
        Creates a single set of distinct objects (according to their equals) for the next parameter of a CartesianTest from the elements of the passed objects.
        Parameters:
        arguments - the objects that should be passed to the parameter
        Returns:
        this ArgumentSets object, for fluent set definitions
      • argumentsForNextParameter

        public final <T> ArgumentSets argumentsForNextParameter​(java.util.stream.Stream<T> arguments)
        Creates a single set of distinct objects (according to their equals) for the next parameter of a CartesianTest from the elements of the passed Stream.
        Parameters:
        arguments - the objects that should be passed to the parameter
        Returns:
        this ArgumentSets object, for fluent set definitions
      • getArguments

        java.util.List<java.util.List<?>> getArguments()