final class TransformerFInto[F[+_], From, To, C <: TransformerCfg, Flags <: TransformerFlags] extends FlagsDsl[[F1]TransformerFInto[F, From, To, C, F1], Flags]
Provides DSL for configuring io.scalaland.chimney.TransformerF's generation and using the result to transform value at the same time
- F
wrapper type constructor
- From
type of input value
- To
type of output value
- C
type-level encoded config
- Flags
type-level encoded flags
- Annotations
- @deprecated
- Deprecated
(Since version Chimney 0.7.0) Lifted transformers are deprecated. Consider using PartialTransformer.
- Since
0.5.0
- Alphabetic
- By Inheritance
- TransformerFInto
- FlagsDsl
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TransformerFInto(source: From, td: TransformerFDefinition[F, From, To, C, Flags])
- source
object to transform
- td
transformer definition
- Deprecated
migration described at https://scalalandio.github.io/chimney/partial-transformers/migrating-from-lifted.html
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
- def __refineTransformerDefinition[C1 <: TransformerCfg](f: (TransformerFDefinition[F, From, To, C, Flags]) => TransformerFDefinition[F, From, To, C1, Flags]): TransformerFInto[F, From, To, C1, Flags]
Used internally by macro.
Used internally by macro. Please don't use in your code.
- 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: TransformerFInto[F, From, To, C, Disable[BeanGetters, Flags]]
Disable Java Beans naming convention (
.getName,.isName) onFrom.Disable Java Beans naming convention (
.getName,.isName) onFrom.- Definition Classes
- FlagsDsl
- Since
0.6.0
- See also
https://scalalandio.github.io/chimney/transformers/java-beans.html#reading-from-java-beans for more details
- def disableBeanSetters: TransformerFInto[F, From, To, C, Disable[BeanSetters, Flags]]
Disable Java Beans naming convention (
.setName(value)) onTo.Disable Java Beans naming convention (
.setName(value)) onTo.- Definition Classes
- FlagsDsl
- Since
0.6.0
- See also
https://scalalandio.github.io/chimney/transformers/java-beans.html#writing-to-java-beans for more details
- def disableDefaultValues: TransformerFInto[F, From, To, C, 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
- FlagsDsl
- Since
0.1.9
- See also
https://scalalandio.github.io/chimney/transformers/default-values.html#enabling-default-values-in-generated-transformer for more details
- def disableImplicitConflictResolution: TransformerFInto[F, From, To, C, 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
- FlagsDsl
- Since
0.7.0
- See also
https://scalalandio.github.io/chimney/partial-transformers/total-vs-partial-conflicts.html for more details
- def disableMethodAccessors: TransformerFInto[F, From, To, C, Disable[MethodAccessors, Flags]]
Disable method accessors lookup that was previously enabled by
enableMethodAccessorsDisable method accessors lookup that was previously enabled by
enableMethodAccessors- Definition Classes
- FlagsDsl
- Since
0.5.0
- See also
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#using-method-accessors for more details
- def disableOptionDefaultsToNone: TransformerFInto[F, From, To, C, Disable[OptionDefaultsToNone, Flags]]
Disable
Nonefallback value for optional fields inTo.Disable
Nonefallback value for optional fields inTo.- Definition Classes
- FlagsDsl
- Since
0.6.0
- See also
https://scalalandio.github.io/chimney/transformers/default-values.html#default-values-for-option-fields for more details
- def enableBeanGetters: TransformerFInto[F, From, To, C, 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
- FlagsDsl
- Since
0.2.1
- See also
https://scalalandio.github.io/chimney/transformers/java-beans.html#reading-from-java-beans for more details
- def enableBeanSetters: TransformerFInto[F, From, To, C, 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
- FlagsDsl
- Since
0.2.1
- See also
https://scalalandio.github.io/chimney/transformers/java-beans.html#writing-to-java-beans for more details
- def enableDefaultValues: TransformerFInto[F, From, To, C, 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
- FlagsDsl
- Since
0.6.0
- See also
https://scalalandio.github.io/chimney/transformers/default-values.html#enabling-default-values-in-generated-transformer for more details
- def enableImplicitConflictResolution[P <: ImplicitTransformerPreference](preference: P): TransformerFInto[F, From, To, C, 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
- FlagsDsl
- Since
0.7.0
- See also
https://scalalandio.github.io/chimney/partial-transformers/total-vs-partial-conflicts.html for more details
- def enableMethodAccessors: TransformerFInto[F, From, To, C, 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
- FlagsDsl
- Since
0.6.0
- See also
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#using-method-accessors for more details
- def enableOptionDefaultsToNone: TransformerFInto[F, From, To, C, 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
- FlagsDsl
- Since
0.2.1
- See also
https://scalalandio.github.io/chimney/transformers/default-values.html#default-values-for-option-fields 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: TransformerFDefinition[F, From, To, C, Flags]
- def toString(): String
- Definition Classes
- AnyRef → Any
- macro def transform[ScopeFlags <: TransformerFlags](implicit tc: TransformerConfiguration[ScopeFlags], tfs: TransformerFSupport[F]): F[To]
Apply configured wrapped transformation in-place.
Apply configured wrapped transformation in-place.
It runs macro that tries to derive instance of
TransformerF[F, From, To]and immediately apply it to capturedsourcevalue.It requires io.scalaland.chimney.TransformerFSupport instance for
Fto be available in implicit scope of invocation of this method.When transformation can't be derived, it results with compilation error.
- returns
transformed value of type
F[To]
- Since
0.5.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): TransformerFInto[F, 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@param f function to calculate values of components that cannot be mapped automatically
- returns
- Since
0.5.0
- See also
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#transforming-coproducts for more details
- macro def withCoproductInstanceF[Inst](f: (Inst) => F[To]): TransformerFInto[F, From, To, _ <: TransformerCfg, Flags]
Use
fto calculate the (missing) wrapped coproduct instance when mapping one coproduct into anotherUse
fto calculate the (missing) wrapped coproduct instance when mapping one coproduct into anotherBy 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@param f function to calculate values of components that cannot be mapped automatically
- returns
- Since
0.5.0
- See also
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#transforming-coproducts for more details
- macro def withFieldComputed[T, U](selector: (To) => T, f: (From) => U)(implicit ev: <:<[U, T]): TransformerFInto[F, 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.5.0
- See also
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#providing-missing-values for more details
- macro def withFieldComputedF[T, U](selector: (To) => T, f: (From) => F[U])(implicit ev: <:<[U, T]): TransformerFInto[F, From, To, _ <: TransformerCfg, Flags]
Use function
fto compute wrapped value of field picked usingselector.Use function
fto compute wrapped 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.5.0
- See also
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#providing-missing-values for more details
- macro def withFieldConst[T, U](selector: (To) => T, value: U)(implicit ev: <:<[U, T]): TransformerFInto[F, From, To, _ <: TransformerCfg, Flags]
Use
valueprovided here for field picked usingselector.Use
valueprovided here for field picked usingselector.By default if
Fromis missing field picked byselectorcompilation 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.5.0
- See also
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#providing-missing-values for more details
- macro def withFieldConstF[T, U](selector: (To) => T, value: F[U])(implicit ev: <:<[U, T]): TransformerFInto[F, From, To, _ <: TransformerCfg, Flags]
Use wrapped
valueprovided here for field picked usingselector.Use wrapped
valueprovided here for field picked usingselector.By default if
Fromis missing field picked byselectorcompilation 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.5.0
- See also
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#providing-missing-values for more details
- macro def withFieldRenamed[T, U](selectorFrom: (From) => T, selectorTo: (To) => U): TransformerFInto[F, 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.5.0
- See also
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#fields-renaming for more details
Deprecated Value Members
- def disableUnsafeOption: TransformerFInto[F, From, To, C, Disable[UnsafeOption, Flags]]
Disable unsafe value extraction from optional fields in
Fromtype.Disable unsafe value extraction from optional fields in
Fromtype.- Definition Classes
- FlagsDsl
- Annotations
- @deprecated
- Deprecated
(Since version Chimney 0.7.0) Unsafe options are deprecated. Consider using PartialTransformer.
- Since
0.6.0
- See also
https://scalalandio.github.io/chimney/transformers/unsafe-options.html for more details
- def enableUnsafeOption: TransformerFInto[F, From, To, C, Enable[UnsafeOption, Flags]]
Enable unsafe call to
.getwhen source type From contains field of typeOption[A], but target type To defines this fields asA.Enable unsafe call to
.getwhen source type From contains field of typeOption[A], but target type To defines this fields asA.It's unsafe as code generated this way may throw at runtime.
By default in such case compilation fails.
- Definition Classes
- FlagsDsl
- Annotations
- @deprecated
- Deprecated
(Since version Chimney 0.7.0) Unsafe options are deprecated. Consider using PartialTransformer.
- Since
0.3.3
- See also
https://scalalandio.github.io/chimney/transformers/unsafe-options.html for more details