PatcherUsing
Provides operations to customize io.scalaland.chimney.Patcher logic for specific object value and patch value.
Type parameters
- A
-
type of object to apply patch to
- Flags
-
type-level encoded flags
- Overrides
-
type-level encoded config
- Patch
-
type of patch object
Value parameters
- obj
-
object to patch
- objPatch
-
patch object
- pd
-
patcher definition
Attributes
- Since
-
0.4.0
- Graph
-
- Supertypes
-
trait WithRuntimeDataStoreclass Objecttrait Matchableclass Any
Members list
Value members
Constructors
Concrete methods
Applies configured patching in-place.
Applies configured patching in-place.
Attributes
- Returns
-
patched value
- Since
-
0.4.0
Use the function f to compute a value of the field picked using the selectorObj.
Use the function f to compute a value of the field picked using the selectorObj.
By default, if Patch is missing a field, the original A's field value is taken.
Type parameters
- T
-
type of patched value field
- U
-
type of computed value
Value parameters
- f
-
function used to compute value of the target field
- selectorObj
-
patched value field in
A, defined like_.name
Attributes
- Returns
- See also
- Since
-
1.7.0
Use the function f to compute a value of the field picked using the selectorObj from a value extracted with selectorPatch as an input.
Use the function f to compute a value of the field picked using the selectorObj from a value extracted with selectorPatch as an input.
By default, if Patch is missing a field, the original A's field value is taken.
Type parameters
- S
-
type of patch field
- T
-
type of patched value field
- U
-
type of computed value
Value parameters
- f
-
function used to compute value of the target field
- selectorObj
-
patched value field in
A, defined like_.name - selectorPatch
-
patch field in
Patch, defined like_.name
Attributes
- Returns
- See also
- Since
-
1.7.0
Use the value provided here for the field picked using the selectorObj.
Use the value provided here for the field picked using the selectorObj.
By default, if Patch is missing a field, the original A's field value is taken.
Attributes
- Returns
- See also
- Since
-
1.7.0
Mark `Patch`` field as expected to be ignored, so that the orignial value would be used.
Mark `Patch`` field as expected to be ignored, so that the orignial value would be used.
Type parameters
- T
-
type of patch field
Value parameters
- selectorPatch
-
patch field in
Patch, defined like_.originalName
Attributes
- Returns
- See also
- Since
-
1.7.0
Define a flag only on some source value using the selectorTo, rather than globally.
Define a flag only on some source value using the selectorTo, rather than globally.
Type parameters
- T
-
type of the target field
Value parameters
- selectorObj
-
patched value field in
A, defined like_.name
Attributes
- Returns
-
io.scalaland.chimney.dsl.PatcherPatchedValueFlagsDsl.OfPatcherUsing
- See also
- Since
-
1.7.0
Inherited methods
In case when both object to patch and patch value contain field with a collection, this option allows to append value from patch to the source value, rather than overriding it.
In case when both object to patch and patch value contain field with a collection, this option allows to append value from patch to the source value, rather than overriding it.
By default, patch's collection overrides the content of a field.
Attributes
- See also
- Since
-
1.7.0
- Inherited from:
- PatcherPatchedValueFlagsDsl (hidden)
When scala.Option is patching scala.Option, on scala.None value will be cleared.
When scala.Option is patching scala.Option, on scala.None value will be cleared.
Attributes
- See also
- Since
-
0.8.0
- Inherited from:
- PatcherPatchedValueFlagsDsl (hidden)
Disable printing the logs from the derivation process.
Disable printing the logs from the derivation process.
Attributes
- See also
-
https://chimney.readthedocs.io/troubleshooting/#debugging-macros for more details
- Since
-
0.8.0
- Inherited from:
- PatcherFlagsDsl (hidden)
Enable printing the logs from the derivation process.
Enable printing the logs from the derivation process.
Attributes
- See also
-
https://chimney.readthedocs.io/troubleshooting/#debugging-macros for more details
- Since
-
0.8.0
- Inherited from:
- PatcherFlagsDsl (hidden)
Fail the compilation if there is a redundant field in patching object.
Fail the compilation if there is a redundant field in patching object.
Attributes
- See also
- Since
-
0.8.0
- Inherited from:
- PatcherPatchedValueFlagsDsl (hidden)
In case when both object to patch and patch value contain field of type scala.Either, this option allows to treat scala.Left value in patch as if the value was not provided.
In case when both object to patch and patch value contain field of type scala.Either, this option allows to treat scala.Left value in patch as if the value was not provided.
By default, when scala.Left is delivered in patch, Chimney used this new value.
Attributes
- See also
- Since
-
1.7.0
- Inherited from:
- PatcherPatchedValueFlagsDsl (hidden)
In case when both object to patch and patch value contain field of type scala.Option, this option allows to treat scala.None value in patch as if the value was not provided.
In case when both object to patch and patch value contain field of type scala.Option, this option allows to treat scala.None value in patch as if the value was not provided.
By default, when scala.None is delivered in patch, Chimney clears the value of such field on patching.
Attributes
- See also
- Since
-
0.4.0
- Inherited from:
- PatcherPatchedValueFlagsDsl (hidden)
In case that patch object contains a redundant field (i.e. field that is not present in patched object type), this option enables ignoring value of such fields and generate patch successfully.
In case that patch object contains a redundant field (i.e. field that is not present in patched object type), this option enables ignoring value of such fields and generate patch successfully.
By default, when Chimney detects a redundant field in patch object, it fails the compilation in order to prevent silent oversight of field name typos.
Attributes
- See also
- Since
-
0.4.0
- Inherited from:
- PatcherPatchedValueFlagsDsl (hidden)
When collection is patching collection, the value will be simply overriden.
When collection is patching collection, the value will be simply overriden.
Attributes
- See also
- Since
-
1.7.0
- Inherited from:
- PatcherPatchedValueFlagsDsl (hidden)
When scala.Either is patching scala.Either, on scala.Left value will be overrides.
When scala.Either is patching scala.Either, on scala.Left value will be overrides.
Attributes
- See also
- Since
-
1.7.0
- Inherited from:
- PatcherPatchedValueFlagsDsl (hidden)