c

io.scalaland.chimney.dsl

TransformerFDefinition

final class TransformerFDefinition[F[+_], From, To, C <: TransformerCfg, Flags <: TransformerFlags] extends FlagsDsl[[F1]TransformerFDefinition[F, From, To, C, F1], Flags] with TransformerDefinitionCommons[[C1]TransformerFDefinition[F, From, To, C1, Flags]]

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

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

Linear Supertypes
TransformerDefinitionCommons[[C1]TransformerFDefinition[F, From, To, C1, Flags]], FlagsDsl[[F1]TransformerFDefinition[F, From, To, C, F1], Flags], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TransformerFDefinition
  2. TransformerDefinitionCommons
  3. FlagsDsl
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new TransformerFDefinition(runtimeData: RuntimeDataStore)

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##: Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def __addInstance(instanceData: Any): TransformerFDefinition.this.type

    Used internally by macro.

    Used internally by macro. Please don't use in your code.

    Definition Classes
    TransformerDefinitionCommons
  5. def __addOverride(overrideData: Any): TransformerFDefinition.this.type

    Used internally by macro.

    Used internally by macro. Please don't use in your code.

    Definition Classes
    TransformerDefinitionCommons
  6. def __refineConfig[C1 <: TransformerCfg]: TransformerFDefinition[F, From, To, C1, Flags]

    Used internally by macro.

    Used internally by macro. Please don't use in your code.

    Definition Classes
    TransformerDefinitionCommons
  7. def __updateRuntimeData(newRuntimeData: RuntimeDataStore): TransformerFDefinition.this.type

    updates runtime data in the upper transformer definition

    updates runtime data in the upper transformer definition

    Attributes
    protected
    Definition Classes
    TransformerFDefinition → TransformerDefinitionCommons
  8. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  9. macro def buildTransformer[ScopeFlags <: TransformerFlags](implicit tfs: TransformerFSupport[F], tc: TransformerConfiguration[ScopeFlags]): 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

    Since

    0.5.0

  10. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  11. def disableBeanGetters: TransformerFDefinition[F, From, To, C, Disable[BeanGetters, Flags]]

    Disable Java Beans naming convention (.getName, .isName) on From.

    Disable Java Beans naming convention (.getName, .isName) on From.

    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

  12. def disableBeanSetters: TransformerFDefinition[F, From, To, C, Disable[BeanSetters, Flags]]

    Disable Java Beans naming convention (.setName(value)) on To.

    Disable Java Beans naming convention (.setName(value)) on To.

    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

  13. def disableDefaultValues: TransformerFDefinition[F, From, To, C, Disable[DefaultValues, Flags]]

    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.

    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

  14. def disableImplicitConflictResolution: TransformerFDefinition[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

  15. def disableMethodAccessors: TransformerFDefinition[F, From, To, C, Disable[MethodAccessors, Flags]]

    Disable method accessors lookup that was previously enabled by enableMethodAccessors

    Disable 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

  16. def disableOptionDefaultsToNone: TransformerFDefinition[F, From, To, C, Disable[OptionDefaultsToNone, Flags]]

    Disable None fallback value for optional fields in To.

    Disable None fallback value for optional fields in To.

    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

  17. def enableBeanGetters: TransformerFDefinition[F, From, To, C, Enable[BeanGetters, Flags]]

    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.

    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

  18. def enableBeanSetters: TransformerFDefinition[F, From, To, C, Enable[BeanSetters, Flags]]

    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.

    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

  19. def enableDefaultValues: TransformerFDefinition[F, From, To, C, Enable[DefaultValues, Flags]]

    Enable fallback to default case class values in To type.

    Enable fallback to default case class values in To type.

    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

  20. def enableImplicitConflictResolution[P <: ImplicitTransformerPreference](preference: P): TransformerFDefinition[F, From, To, C, Enable[ImplicitConflictResolution[P], Flags]]

    Enable conflict resolution when both Transformer and PartialTransformer are available in the implicit scope.

    Enable conflict resolution when both Transformer and PartialTransformer are 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

  21. def enableMethodAccessors: TransformerFDefinition[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

  22. def enableOptionDefaultsToNone: TransformerFDefinition[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

  23. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  24. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  25. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  26. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  27. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  28. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  29. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  30. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  31. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  32. val runtimeData: RuntimeDataStore

    runtime storage for values and functions that transformer definition is customized with

    runtime storage for values and functions that transformer definition is customized with

    Definition Classes
    TransformerFDefinition → TransformerDefinitionCommons
  33. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  34. def toString(): String
    Definition Classes
    AnyRef → Any
  35. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  37. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  38. macro def withCoproductInstance[Inst <: From](f: (Inst) => To): TransformerFDefinition[F, From, To, _ <: TransformerCfg, Flags]

    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 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.

    Inst

    type of coproduct instance

    f

    function to calculate values of components that cannot be mapped automatically

    returns

    io.scalaland.chimney.dsl.TransformerFDefinition

    Since

    0.5.0

    See also

    https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#transforming-coproducts for more details

  39. macro def withCoproductInstanceF[Inst](f: (Inst) => F[To]): TransformerFDefinition[F, From, To, _ <: TransformerCfg, Flags]

    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.

    Inst

    type of coproduct instance

    f

    function to calculate values of components that cannot be mapped automatically

    returns

    io.scalaland.chimney.dsl.TransformerFDefinition

    Since

    0.5.0

    See also

    https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#transforming-coproducts for more details

  40. macro def withFieldComputed[T, U](selector: (To) => T, f: (From) => U)(implicit ev: <:<[U, T]): TransformerFDefinition[F, From, To, _ <: TransformerCfg, Flags]

    Use function f to compute value of field picked using selector.

    Use function f to compute value of field picked using selector.

    By default if From is missing field picked by selector compilation 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

    io.scalaland.chimney.dsl.TransformerFDefinition

    Since

    0.5.0

    See also

    https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#providing-missing-values for more details

  41. macro def withFieldComputedF[T, U](selector: (To) => T, f: (From) => F[U])(implicit ev: <:<[U, T]): TransformerFDefinition[F, From, To, _ <: TransformerCfg, Flags]

    Use f provided here to compute wrapped value of field picked using selector.

    Use f provided here to compute wrapped value of field picked using selector.

    By default if From is missing field picked by selector compilation 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

    io.scalaland.chimney.dsl.TransformerFDefinition

    Since

    0.5.0

    See also

    https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#providing-missing-values for more details

  42. macro def withFieldConst[T, U](selector: (To) => T, value: U)(implicit ev: <:<[U, T]): TransformerFDefinition[F, From, To, _ <: TransformerCfg, Flags]

    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.

    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

    io.scalaland.chimney.dsl.TransformerFDefinition

    Since

    0.5.0

    See also

    https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#providing-missing-values for more details

  43. macro def withFieldConstF[T, U](selector: (To) => T, value: F[U])(implicit ev: <:<[U, T]): TransformerFDefinition[F, From, To, _ <: TransformerCfg, Flags]

    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.

    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

    io.scalaland.chimney.dsl.TransformerFDefinition

    Since

    0.5.0

    See also

    https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#providing-missing-values for more details

  44. macro def withFieldRenamed[T, U](selectorFrom: (From) => T, selectorTo: (To) => U): TransformerFDefinition[F, From, To, _ <: TransformerCfg, Flags]

    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.

    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

    io.scalaland.chimney.dsl.TransformerFDefinition

    Since

    0.5.0

    See also

    https://scalalandio.github.io/chimney/transformers/customizing-transformers.html#fields-renaming for more details

Deprecated Value Members

  1. def disableUnsafeOption: TransformerFDefinition[F, From, To, C, Disable[UnsafeOption, Flags]]

    Disable unsafe value extraction from optional fields in From type.

    Disable unsafe value extraction from optional fields in From type.

    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

  2. def enableUnsafeOption: TransformerFDefinition[F, From, To, C, Enable[UnsafeOption, Flags]]

    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.

    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

Inherited from TransformerDefinitionCommons[[C1]TransformerFDefinition[F, From, To, C1, Flags]]

Inherited from FlagsDsl[[F1]TransformerFDefinition[F, From, To, C, F1], Flags]

Inherited from AnyRef

Inherited from Any

Ungrouped