object to transform
transformer definition
Used internally by macro.
Used internally by macro. Please don't use in your code.
Fail derivation if From
type is missing field even if To
has default value for it.
Fail derivation if From
type is missing field even if To
has default value for it.
By default in such case derivation will fallback to default values.
https://scalalandio.github.io/chimney/transformers/default-values.html#disabling-default-values-in-generated-transformer for more details
Enable Java Beans naming convention (.getName
, .isName
) on From
.
Enable Java Beans naming convention (.getName
, .isName
) on From
.
By default only Scala conversions (.name
) are allowed.
https://scalalandio.github.io/chimney/transformers/java-beans.html#reading-from-java-beans for more details
Enable Java Beans naming convention (.setName(value)
) on To
.
Enable Java Beans naming convention (.setName(value)
) on To
.
By default only Scala conversions (.copy(name = value)
) are allowed.
https://scalalandio.github.io/chimney/transformers/java-beans.html#writing-to-java-beans for more details
Enable values to be supplied from method calls.
Enable values to be supplied from method calls. Source method must be public and have no parameter list.
By default this is disabled because method calls may perform side effects (e.g. mutations)
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#using-method-accessors for more details
Sets target value of optional field to None if field is missing from source type From.
Sets target value of optional field to None if field is missing from source type From.
By default in such case compilation fails.
https://scalalandio.github.io/chimney/transformers/default-values.html#default-values-for-option-fields for more details
Enable unsafe call to .get
when source type From contains field of type Option[A]
,
but target type To defines this fields as A
.
Enable unsafe call to .get
when source type From contains field of type Option[A]
,
but target type To defines this fields as A
.
It's unsafe as code generated this way may throw at runtime.
By default in such case compilation fails.
https://scalalandio.github.io/chimney/transformers/unsafe-options.html for more details
Lifts current transformation with provided type constructor F
.
Lifts current transformation with provided type constructor F
.
It keeps all the configuration, provided missing values, renames, coproduct instances etc.
wrapper type constructor
object to transform
transformer definition
Apply configured transformation in-place.
Apply configured transformation in-place.
It runs macro that tries to derive instance of Transformer[From, To]
and immediately apply it to captured source
value.
When transformation can't be derived, it results with compilation error.
transformed value of type To
Use f
to calculate the (missing) coproduct instance when mapping one coproduct into another
Use f
to calculate the (missing) coproduct instance when mapping one coproduct into another
By default if mapping one coproduct in From
into another coproduct in To
derivation
expects that coproducts will have matching names of its components, and for every component
in To
field's type there is matching component in From
type. If some component is missing
it will fail.
function to calculate values of components that cannot be mapped automatically
Use f
to calculate the (missing) wrapped coproduct instance when mapping one coproduct into another
Use f
to calculate the (missing) wrapped coproduct instance when mapping one coproduct into another
By default if mapping one coproduct in From
into another coproduct in To
derivation
expects that coproducts to have matching names of its components, and for every component
in To
field's type there is matching component in From
type. If some component is missing
it fails compilation unless provided replacement with this operation.
function to calculate values of components that cannot be mapped automatically
Use map
provided here to compute value of field picked using selector
.
Use map
provided here to compute value of field picked using selector
.
By default if From
is missing field picked by selector
compilation fails.
target field in To
, defined like _.name
function used to compute value of the target field
Use map
provided here to compute wrapped value of field picked using selector
.
Use map
provided here to compute wrapped value of field picked using selector
.
By default if From
is missing field picked by selector
compilation fails.
target field in To
, defined like _.name
function used to compute value of the target field
Use value
provided here for field picked using selector
.
Use value
provided here for field picked using selector
.
By default if From
is missing field picked by selector
compilation fails.
Use wrapped value
provided here for field picked using selector
.
Use wrapped value
provided here for field picked using selector
.
By default if From
is missing field picked by selector
compilation fails.
target field in To
, defined like _.name
constant value to use for the target field
Use selectorFrom
field in From
to obtain the value of selectorTo
field in To
Use selectorFrom
field in From
to obtain the value of selectorTo
field in To
By default if From
is missing field picked by selectorTo
compilation fails.
source field in From
, defined like _.originalName
target field in To
, defined like _.newName
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#fields-renaming for more details
(Since version ) see corresponding Javadoc for more information.
Provides DSL for configuring io.scalaland.chimney.Transformer's generation and using the result to transform value at the same time
type of input value
type of output value
type-level encoded config