Package org.instancio

Interface GivenOriginDestination

All Known Subinterfaces:
GivenOriginDestinationAction

@ExperimentalApi public interface GivenOriginDestination
Represents an origin and a destination of a conditional assigment.
Since:
3.0.0
See Also:
  • Method Details

    • generate

      <S, T> GivenOriginDestinationAction generate(Predicate<S> predicate, GeneratorSpecProvider<T> gen)
      Generates values using built-in generators provided by the gen parameter, of type Generators.

      This method provides the same functionality as the top-level API: InstancioApi.generate(TargetSelector, GeneratorSpecProvider)

      Type Parameters:
      S - the type of object the predicate is evaluated against
      T - the type of object to generate
      Parameters:
      predicate - that must be satisfied by the predicate
      gen - provider of customisable built-in generators (also known as specs)
      Returns:
      assignment builder reference
      Since:
      3.0.0
    • generate

      <S, T> GivenOriginDestinationAction generate(Predicate<S> predicate, GeneratorSpec<T> spec)
      Generates values using arbitrary generator specs.

      This method provides the same functionality as the top-level API: InstancioApi.generate(TargetSelector, GeneratorSpec)

      Type Parameters:
      S - the type of object the predicate is evaluated against
      T - the type of object to generate
      Parameters:
      predicate - that must be satisfied by the predicate
      spec - generator spec for generating values
      Returns:
      assignment builder reference
      Since:
      3.0.0
    • set

      <S, T> GivenOriginDestinationAction set(Predicate<S> predicate, T value)
      Sets a value to matching selector targets.

      This method provides the same functionality as the top-level API: InstancioApi.set(TargetSelector, Object)

      Type Parameters:
      S - the type of object the predicate is evaluated against
      T - the type of object to set
      Parameters:
      predicate - that must be satisfied by the predicate
      value - value to set
      Returns:
      assignment builder reference
      Since:
      3.0.0
    • supply

      <S, T> GivenOriginDestinationAction supply(Predicate<S> predicate, Generator<T> generator)
      Supplies an object using a Generator to matching selector targets.

      This method provides the same functionality as the top-level API: InstancioApi.supply(TargetSelector, Generator)

      Type Parameters:
      S - the type of object the predicate is evaluated against
      T - the type of object to generate
      Parameters:
      predicate - that must be satisfied by the predicate
      generator - for generating values
      Returns:
      assignment builder reference
      Since:
      3.0.0
    • supply

      <S, T> GivenOriginDestinationAction supply(Predicate<S> predicate, Supplier<T> supplier)
      Supplies an object using a Supplier.

      This method provides the same functionality as the top-level API: InstancioApi.supply(TargetSelector, Supplier)

      Type Parameters:
      S - the type of object the predicate is evaluated against
      T - the type of object to supply
      Parameters:
      predicate - that must be satisfied by the predicate
      supplier - for supplying values
      Returns:
      assignment builder reference
      Since:
      3.0.0