Package org.instancio
Interface ValueOf
Value of a target selector of an assignment.
- Since:
- 3.0.0
- See Also:
-
Method Summary
Modifier and TypeMethodDescription<T> Assignment
generate
(GeneratorSpec<T> spec) Generates values using arbitrary generator specs.<T> Assignment
generate
(GeneratorSpecProvider<T> gen) Generates values using built-in generators provided by thegen
parameter, of typeGenerators
.<T> Assignment
set
(T value) Sets a value to matching selector targets.<T> Assignment
Supplies an object using aSupplier
.<T> Assignment
Supplies an object using aGenerator
to matching selector targets.<T,
R> ValueOfOriginDestination to
(GetMethodSelector<T, R> destination) Specifies the destination method reference for the assignment.to
(TargetSelector destination) Specifies the destination selector for the assignment.
-
Method Details
-
to
Specifies the destination selector for the assignment.- Parameters:
destination
- selector- Returns:
- an assigment containing origin and destination selectors
- Since:
- 3.0.0
-
to
Specifies the destination method reference for the assignment. This is a shorthand API ofto(TargetSelector)
allowing:to(field(Pojo::getValue))
to be specified as a slightly shorter version:
to(Pojo::getValue)
- Type Parameters:
T
- type declaring the methodR
- return type of the method- Parameters:
destination
- method reference- Returns:
- an assigment containing origin and destination selectors
- Since:
- 3.0.0
-
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
- the type of object to generate- Parameters:
gen
- provider of customisable built-in generators (also known as specs)- Returns:
- an assignment
- 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
- the type of object to generate- Parameters:
spec
- generator spec for generating values- Returns:
- an assignment
- 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
- the type of object to set- Parameters:
value
- value to set- Returns:
- an assignment
- 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
- the type of object to generate- Parameters:
generator
- for generating values- Returns:
- an assignment
- 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
- the type of object to supply- Parameters:
supplier
- for supplying values- Returns:
- an assignment
- Since:
- 3.0.0
-