final class TransformerFDefinition[F[+_], From, To, C <: TransformerCfg] extends ConfigDsl[[C1]TransformerFDefinition[F, From, To, C1], C]
Allows customization of io.scalaland.chimney.TransformerF derivation
- F
wrapper type constructor
- From
type of input value
- To
type of output value
- C
type-level encoded config
- Alphabetic
- By Inheritance
- TransformerFDefinition
- ConfigDsl
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Instance Constructors
- new TransformerFDefinition(overrides: Map[String, Any], instances: Map[(String, String), Any])
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 __addInstance(from: String, to: String, value: Any): TransformerFDefinition[F, From, To, C]
Used internally by macro.
Used internally by macro. Please don't use in your code.
- def __addOverride(key: String, value: Any): TransformerFDefinition[F, From, To, C]
Used internally by macro.
Used internally by macro. Please don't use in your code.
- def __refineConfig[C1 <: TransformerCfg]: TransformerFDefinition[F, From, To, C1]
Used internally by macro.
Used internally by macro. Please don't use in your code.
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- macro def buildTransformer(implicit tfs: TransformerFSupport[F]): TransformerF[F, From, To]
Build TransformerF using current configuration.
Build TransformerF using current configuration.
It runs macro that tries to derive instance of
TransformerF[F, From, To]
.It requires io.scalaland.chimney.TransformerFSupport instance for
F
to be available in implicit scope of invocation of this method.When transformation can't be derived, it results with compilation error.
- returns
io.scalaland.chimney.TransformerF type class instance
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- def disableDefaultValues: TransformerFDefinition[F, From, To, DisableDefaultValues[C]]
Fail derivation if
From
type is missing field even ifTo
has default value for it.Fail derivation if
From
type is missing field even ifTo
has default value for it.By default in such case derivation will fallback to default values.
- Definition Classes
- ConfigDsl
- See also
https://scalalandio.github.io/chimney/transformers/default-values.html#disabling-default-values-in-generated-transformer for more details
- def enableBeanGetters: TransformerFDefinition[F, From, To, EnableBeanGetters[C]]
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
- ConfigDsl
- See also
https://scalalandio.github.io/chimney/transformers/java-beans.html#reading-from-java-beans for more details
- def enableBeanSetters: TransformerFDefinition[F, From, To, EnableBeanSetters[C]]
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
- ConfigDsl
- See also
https://scalalandio.github.io/chimney/transformers/java-beans.html#writing-to-java-beans for more details
- def enableMethodAccessors: TransformerFDefinition[F, From, To, EnableMethodAccessors[C]]
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
- ConfigDsl
- See also
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#using-method-accessors for more details
- def enableOptionDefaultsToNone: TransformerFDefinition[F, From, To, EnableOptionDefaultsToNone[C]]
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
- ConfigDsl
- See also
https://scalalandio.github.io/chimney/transformers/default-values.html#default-values-for-option-fields for more details
- def enableUnsafeOption: TransformerFDefinition[F, From, To, EnableUnsafeOption[C]]
Enable unsafe call to
.get
when source type From contains field of typeOption[A]
, but target type To defines this fields asA
.Enable unsafe call to
.get
when 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
- ConfigDsl
- See also
https://scalalandio.github.io/chimney/transformers/unsafe-options.html for more details
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val instances: Map[(String, String), Any]
- 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() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- val overrides: Map[String, Any]
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- 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()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- macro def withCoproductInstance[Inst <: From](f: (Inst) => To): TransformerFDefinition[F, From, To, _ <: TransformerCfg]
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 inTo
derivation expects that coproducts to have matching names of its components, and for every component inTo
field's type there is matching component inFrom
type. If some component is missing it fails compilation unless provided replacement with this operation.- f
function to calculate values of components that cannot be mapped automatically
- returns
- macro def withCoproductInstanceF[Inst](f: (Inst) => F[To]): TransformerFDefinition[F, From, To, _ <: TransformerCfg]
Use
f
to calculate the (missing) wrapped coproduct instance when mapping one coproduct into anotherUse
f
to calculate the (missing) wrapped coproduct instance when mapping one coproduct into anotherBy default if mapping one coproduct in
From
into another coproduct inTo
derivation expects that coproducts to have matching names of its components, and for every component inTo
field's type there is matching component inFrom
type. If some component is missing it fails compilation unless provided replacement with this operation.- f
function to calculate values of components that cannot be mapped automatically
- returns
- macro def withFieldComputed[T, U](selector: (To) => T, map: (From) => U): TransformerFDefinition[F, From, To, _ <: TransformerCfg]
Use
map
provided here to compute value of field picked usingselector
.Use
map
provided here to compute value of field picked usingselector
.By default if
From
is missing field picked byselector
compilation fails.- selector
target field in
To
, defined like_.name
- map
function used to compute value of the target field
- returns
- macro def withFieldComputedF[T, U](selector: (To) => T, map: (From) => F[U]): TransformerFDefinition[F, From, To, _ <: TransformerCfg]
Use
map
provided here to compute wrapped value of field picked usingselector
.Use
map
provided here to compute wrapped value of field picked usingselector
.By default if
From
is missing field picked byselector
compilation fails.- selector
target field in
To
, defined like_.name
- map
function used to compute value of the target field
- returns
- macro def withFieldConst[T, U](selector: (To) => T, value: U): TransformerFDefinition[F, From, To, _ <: TransformerCfg]
Use
value
provided here for field picked usingselector
.Use
value
provided here for field picked usingselector
.By default if
From
is missing field picked byselector
compilation fails.- selector
target field in
To
, defined like_.name
- value
constant value to use for the target field
- returns
- macro def withFieldConstF[T, U](selector: (To) => T, value: F[U]): TransformerFDefinition[F, From, To, _ <: TransformerCfg]
Use wrapped
value
provided here for field picked usingselector
.Use wrapped
value
provided here for field picked usingselector
.By default if
From
is missing field picked byselector
compilation fails.- selector
target field in
To
, defined like_.name
- value
constant value to use for the target field
- returns
- macro def withFieldRenamed[T, U](selectorFrom: (From) => T, selectorTo: (To) => U): TransformerFDefinition[F, From, To, _ <: TransformerCfg]
Use
selectorFrom
field inFrom
to obtain the value ofselectorTo
field inTo
Use
selectorFrom
field inFrom
to obtain the value ofselectorTo
field inTo
By default if
From
is missing field picked byselectorTo
compilation fails.- selectorFrom
source field in
From
, defined like_.originalName
- selectorTo
target field in
To
, defined like_.newName
- returns
- See also
https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#fields-renaming for more details
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated