Package org.instancio
Interface GivenOriginPredicate
- All Known Subinterfaces:
GivenOriginPredicateAction
Defines methods one of which follow the
Assign.given(TargetSelector)
builder expressions
to create an assignment.- Since:
- 3.0.0
-
Method Summary
Modifier and TypeMethodDescriptiongenerate
(TargetSelector selector, GeneratorSpec<T> spec) Generates values using arbitrary generator specs.generate
(TargetSelector selector, GeneratorSpecProvider<T> gen) Generates values using built-in generators provided by thegen
parameter, of typeGenerators
.set
(TargetSelector selector, T value) Sets a value to matching selector targets.supply
(TargetSelector selector, Supplier<T> supplier) Supplies an object using aSupplier
.supply
(TargetSelector selector, Generator<T> generator) Supplies an object using aGenerator
to matching selector targets.
-
Method Details
-
generate
Generates values using built-in generators provided by thegen
parameter, of typeGenerators
.This method provides the same functionality as the top-level API:
InstancioApi.generate(TargetSelector, GeneratorSpecProvider)
- Type Parameters:
T
- type of object to generate- Parameters:
selector
- for fields and/or classes this method should be applied togen
- provider of customisable built-in generators (also known as specs)- Returns:
- assignment builder reference
- Since:
- 3.0.0
-
generate
Generates values using arbitrary generator specs.This method provides the same functionality as the top-level API:
InstancioApi.generate(TargetSelector, GeneratorSpec)
- Type Parameters:
T
- type of object to generate- Parameters:
selector
- for fields and/or classes this method should be applied tospec
- generator spec for generating values- Returns:
- assignment builder reference
- Since:
- 3.0.0
-
set
Sets a value to matching selector targets.This method provides the same functionality as the top-level API:
InstancioApi.set(TargetSelector, Object)
- Type Parameters:
T
- type of the value- Parameters:
selector
- for fields and/or classes this method should be applied tovalue
- value to set- Returns:
- assignment builder reference
- Since:
- 3.0.0
-
supply
Supplies an object using aGenerator
to matching selector targets.This method provides the same functionality as the top-level API:
InstancioApi.supply(TargetSelector, Generator)
- Type Parameters:
T
- type of the value to generate- Parameters:
selector
- for fields and/or classes this method should be applied togenerator
- for generating values- Returns:
- assignment builder reference
- Since:
- 3.0.0
-
supply
Supplies an object using aSupplier
.This method provides the same functionality as the top-level API:
InstancioApi.supply(TargetSelector, Supplier)
- Type Parameters:
T
- type of the supplied value- Parameters:
selector
- for fields and/or classes this method should be applied tosupplier
- for supplying values- Returns:
- assignment builder reference
- Since:
- 3.0.0
-