final class PartialTransformerInto[From, To, Cfg <: TransformerCfg, Flags <: TransformerFlags] extends TransformerFlagsDsl[[Flags1]PartialTransformerInto[From, To, Cfg, Flags1], Flags] with WithRuntimeDataStore
Provides DSL for configuring io.scalaland.chimney.PartialTransformer's generation and using the result to transform value at the same time
- From
type of input value
- To
type of output value
- Cfg
type-level encoded config
- Flags
type-level encoded flags
- Since
0.7.0
- Alphabetic
- By Inheritance
- PartialTransformerInto
- WithRuntimeDataStore
- TransformerFlagsDsl
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new PartialTransformerInto(source: From, td: PartialTransformerDefinition[From, To, Cfg, Flags])
- source
object to transform
- td
transformer definition
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native()
- def disableBeanGetters: PartialTransformerInto[From, To, Cfg, Disable[BeanGetters, Flags]]
Disable Java Beans naming convention (
.getName,.isName) onFrom.Disable Java Beans naming convention (
.getName,.isName) onFrom.- Definition Classes
- TransformerFlagsDsl
- Since
0.6.0
- See also
https://chimney.readthedocs.io/supported-transformations/#reading-from-bean-getters for more details
- def disableBeanSetters: PartialTransformerInto[From, To, Cfg, Disable[BeanSetters, Flags]]
Disable Java Beans naming convention (
.setName(value)) onTo.Disable Java Beans naming convention (
.setName(value)) onTo.- Definition Classes
- TransformerFlagsDsl
- Since
0.6.0
- See also
https://chimney.readthedocs.io/supported-transformations/#writing-to-bean-setters for more details
- def disableDefaultValues: PartialTransformerInto[From, To, Cfg, Disable[DefaultValues, Flags]]
Fail derivation if
Fromtype is missing field even ifTohas default value for it.Fail derivation if
Fromtype is missing field even ifTohas default value for it.- Definition Classes
- TransformerFlagsDsl
- Since
0.1.9
- See also
https://chimney.readthedocs.io/supported-transformations/#allowing-fallback-to-the-constructors-default-values for more details
- def disableImplicitConflictResolution: PartialTransformerInto[From, To, Cfg, Disable[ImplicitConflictResolution[_], Flags]]
Disable any implicit conflict resolution preference that was set previously.
Disable any implicit conflict resolution preference that was set previously.
- Definition Classes
- TransformerFlagsDsl
- Since
0.7.0
- See also
https://chimney.readthedocs.io/supported-transformations/#resolving-priority-of-implicit-total-vs-partial-transformers for more details
- def disableInheritedAccessors: PartialTransformerInto[From, To, Cfg, Disable[InheritedAccessors, Flags]]
Disable inherited accessors lookup that was previously enabled by
enableInheritedAccessorsDisable inherited accessors lookup that was previously enabled by
enableInheritedAccessors- Definition Classes
- TransformerFlagsDsl
- Since
0.8.0
- See also
https://chimney.readthedocs.io/supported-transformations/#reading-from-inherited-valuesmethods for more details
- def disableMacrosLogging: PartialTransformerInto[From, To, Cfg, Disable[MacrosLogging, Flags]]
Disable printing the logs from the derivation process.
Disable printing the logs from the derivation process.
- Definition Classes
- TransformerFlagsDsl
- Since
0.8.0
- See also
https://chimney.readthedocs.io/troubleshooting/#debugging-macros for more details
- def disableMethodAccessors: PartialTransformerInto[From, To, Cfg, Disable[MethodAccessors, Flags]]
Disable method accessors lookup that was previously enabled by
enableMethodAccessorsDisable method accessors lookup that was previously enabled by
enableMethodAccessors- Definition Classes
- TransformerFlagsDsl
- Since
0.5.0
- See also
https://chimney.readthedocs.io/supported-transformations/#reading-from-methods for more details
- def disableOptionDefaultsToNone: PartialTransformerInto[From, To, Cfg, Disable[OptionDefaultsToNone, Flags]]
Disable
Nonefallback value for optional fields inTo.Disable
Nonefallback value for optional fields inTo.- Definition Classes
- TransformerFlagsDsl
- Since
0.6.0
- See also
https://chimney.readthedocs.io/supported-transformations/#allowing-fallback-to-none-as-the-constructors-argument for more details
- def enableBeanGetters: PartialTransformerInto[From, To, Cfg, Enable[BeanGetters, Flags]]
Enable Java Beans naming convention (
.getName,.isName) onFrom.Enable Java Beans naming convention (
.getName,.isName) onFrom.By default only Scala conversions (
.name) are allowed.- Definition Classes
- TransformerFlagsDsl
- Since
0.2.1
- See also
https://chimney.readthedocs.io/supported-transformations/#reading-from-bean-getters for more details
- def enableBeanSetters: PartialTransformerInto[From, To, Cfg, Enable[BeanSetters, Flags]]
Enable Java Beans naming convention (
.setName(value)) onTo.Enable Java Beans naming convention (
.setName(value)) onTo.By default only Scala conversions (
.copy(name = value)) are allowed.- Definition Classes
- TransformerFlagsDsl
- Since
0.2.1
- See also
https://chimney.readthedocs.io/supported-transformations/#writing-to-bean-setters for more details
- def enableDefaultValues: PartialTransformerInto[From, To, Cfg, Enable[DefaultValues, Flags]]
Enable fallback to default case class values in
Totype.Enable fallback to default case class values in
Totype.By default in such case derivation will fail. By enabling this flag, derivation will fallback to default value.
- Definition Classes
- TransformerFlagsDsl
- Since
0.6.0
- See also
https://chimney.readthedocs.io/supported-transformations/#allowing-fallback-to-the-constructors-default-values for more details
- def enableImplicitConflictResolution[P <: ImplicitTransformerPreference](preference: P): PartialTransformerInto[From, To, Cfg, Enable[ImplicitConflictResolution[P], Flags]]
Enable conflict resolution when both
TransformerandPartialTransformerare available in the implicit scope.Enable conflict resolution when both
TransformerandPartialTransformerare available in the implicit scope.- preference
parameter specifying which implicit transformer to pick in case of conflict
- Definition Classes
- TransformerFlagsDsl
- Since
0.7.0
- See also
https://chimney.readthedocs.io/supported-transformations/#resolving-priority-of-implicit-total-vs-partial-transformers for more details
- def enableInheritedAccessors: PartialTransformerInto[From, To, Cfg, Enable[InheritedAccessors, Flags]]
Enable lookup in definitions inherited from supertype.
Enable lookup in definitions inherited from supertype.
By default only values defined directly in the type are considered. With this flag supertype methods would not be filtered out
- Definition Classes
- TransformerFlagsDsl
- Since
0.8.0
- See also
https://chimney.readthedocs.io/supported-transformations/#reading-from-inherited-valuesmethods for more details
- def enableMacrosLogging: PartialTransformerInto[From, To, Cfg, Enable[MacrosLogging, Flags]]
Enable printing the logs from the derivation process.
Enable printing the logs from the derivation process.
- Definition Classes
- TransformerFlagsDsl
- Since
0.8.0
- See also
https://chimney.readthedocs.io/troubleshooting/#debugging-macros for more details
- def enableMethodAccessors: PartialTransformerInto[From, To, Cfg, Enable[MethodAccessors, Flags]]
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)
- Definition Classes
- TransformerFlagsDsl
- Since
0.6.0
- See also
https://chimney.readthedocs.io/supported-transformations/#reading-from-methods for more details
- def enableOptionDefaultsToNone: PartialTransformerInto[From, To, Cfg, Enable[OptionDefaultsToNone, Flags]]
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.
- Definition Classes
- TransformerFlagsDsl
- Since
0.2.1
- See also
https://chimney.readthedocs.io/supported-transformations/#allowing-fallback-to-none-as-the-constructors-argument for more details
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable])
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native()
- val source: From
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- val td: PartialTransformerDefinition[From, To, Cfg, Flags]
- def toString(): String
- Definition Classes
- AnyRef → Any
- macro def transform[ImplicitScopeFlags <: TransformerFlags](implicit tc: TransformerConfiguration[ImplicitScopeFlags]): Result[To]
Apply configured partial transformation in-place.
Apply configured partial transformation in-place.
It runs macro that tries to derive instance of
PartialTransformer[From, To]and immediately apply it to capturedsourcevalue. When transformation can't be derived, it results with compilation error.- returns
partial transformation result of type
partial.Result[To]
- Since
0.7.0
- macro def transformFailFast[ImplicitScopeFlags <: TransformerFlags](implicit tc: TransformerConfiguration[ImplicitScopeFlags]): Result[To]
Apply configured partial transformation in-place in a short-circuit (fail fast) mode.
Apply configured partial transformation in-place in a short-circuit (fail fast) mode.
It runs macro that tries to derive instance of
PartialTransformer[From, To]and immediately apply it to capturedsourcevalue. When transformation can't be derived, it results with compilation error.- returns
partial transformation result of type
partial.Result[To]
- Since
0.7.0
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- macro def withCoproductInstance[Inst](f: (Inst) => To): PartialTransformerInto[From, To, _ <: TransformerCfg, Flags]
Use
fto calculate the (missing) coproduct instance when mapping one coproduct into another.Use
fto calculate the (missing) coproduct instance when mapping one coproduct into another.By default if mapping one coproduct in
Frominto another coproduct inToderivation expects that coproducts to have matching names of its components, and for every component inTofield's type there is matching component inFromtype. If some component is missing it fails compilation unless provided replacement with this operation.- Inst
type of coproduct instance
- f
function to calculate values of components that cannot be mapped automatically
- returns
- Since
0.7.0
- See also
for more details
- macro def withCoproductInstancePartial[Inst](f: (Inst) => Result[To]): PartialTransformerInto[From, To, _ <: TransformerCfg, Flags]
Use
fto calculate the (missing) coproduct instance partial result when mapping one coproduct into another.Use
fto calculate the (missing) coproduct instance partial result when mapping one coproduct into another.By default if mapping one coproduct in
Frominto another coproduct inToderivation expects that coproducts to have matching names of its components, and for every component inTofield's type there is matching component inFromtype. If some component is missing it fails compilation unless provided replacement with this operation.- Inst
type of coproduct instance
- f
function to calculate values of components that cannot be mapped automatically
- returns
- Since
0.7.0
- See also
for more details
- macro def withFieldComputed[T, U](selector: (To) => T, f: (From) => U)(implicit ev: <:<[U, T]): PartialTransformerInto[From, To, _ <: TransformerCfg, Flags]
Use function
fto compute value of field picked usingselector.Use function
fto compute value of field picked usingselector.By default if
Fromis missing field picked byselectorcompilation fails.- T
type of target field
- U
type of computed value
- selector
target field in
To, defined like_.name- f
function used to compute value of the target field
- returns
- Since
0.7.0
- See also
https://chimney.readthedocs.io/supported-transformations/#wiring-the-constructors-parameter-to-computed-value for more details
- macro def withFieldComputedPartial[T, U](selector: (To) => T, f: (From) => Result[U])(implicit ev: <:<[U, T]): PartialTransformerInto[From, To, _ <: TransformerCfg, Flags]
Use function
fto compute partial result for field picked usingselector.Use function
fto compute partial result for field picked usingselector.By default if
Fromis missing field picked byselectorcompilation fails.- T
type of target field
- U
type of computed value
- selector
target field in
To, defined like_.name- f
function used to compute value of the target field
- returns
- Since
0.7.0
- See also
https://chimney.readthedocs.io/supported-transformations/#wiring-the-constructors-parameter-to-computed-value for more details
- macro def withFieldConst[T, U](selector: (To) => T, value: U)(implicit ev: <:<[U, T]): PartialTransformerInto[From, To, _ <: TransformerCfg, Flags]
Use provided
valuefor field picked usingselector.Use provided
valuefor field picked usingselector.By default if
Fromis missing field picked byselector, compilation fails.- T
type of target field
- U
type of provided value
- selector
target field in
To, defined like_.name- value
constant value to use for the target field
- returns
- Since
0.7.0
- See also
https://chimney.readthedocs.io/supported-transformations/#wiring-the-constructors-parameter-to-a-provided-value for more details
- macro def withFieldConstPartial[T, U](selector: (To) => T, value: Result[U])(implicit ev: <:<[U, T]): PartialTransformerInto[From, To, _ <: TransformerCfg, Flags]
Use provided partial result
valuefor field picked usingselector.Use provided partial result
valuefor field picked usingselector.By default if
Fromis missing field picked byselector, compilation fails.- T
type of target field
- U
type of provided value
- selector
target field in
To, defined like_.name- value
constant value to use for the target field
- returns
- Since
0.7.0
- See also
https://chimney.readthedocs.io/supported-transformations/#wiring-the-constructors-parameter-to-a-provided-value for more details
- macro def withFieldRenamed[T, U](selectorFrom: (From) => T, selectorTo: (To) => U): PartialTransformerInto[From, To, _ <: TransformerCfg, Flags]
Use
selectorFromfield inFromto obtain the value ofselectorTofield inToUse
selectorFromfield inFromto obtain the value ofselectorTofield inToBy default if
Fromis missing field picked byselectorTocompilation fails.- T
type of source field
- U
type of target field
- selectorFrom
source field in
From, defined like_.originalName- selectorTo
target field in
To, defined like_.newName- returns
- Since
0.7.0
- See also
https://chimney.readthedocs.io/supported-transformations/#wiring-the-constructors-parameter-to-its-source-field for more details