Packages

c

io.scalaland.chimney.dsl

PartialTransformerDefinition

final class PartialTransformerDefinition[From, To, Cfg <: TransformerCfg, Flags <: TransformerFlags] extends TransformerFlagsDsl[[Flags1]PartialTransformerDefinition[From, To, Cfg, Flags1], Flags] with TransformerDefinitionCommons[[Cfg1]PartialTransformerDefinition[From, To, Cfg1, Flags]] with WithRuntimeDataStore

Allows customization of io.scalaland.chimney.PartialTransformer derivation.

From

type of input value

To

type of output value

Cfg

type-level encoded config

Flags

type-level encoded flags

Since

0.7.0

Linear Supertypes
WithRuntimeDataStore, TransformerDefinitionCommons[[Cfg1]PartialTransformerDefinition[From, To, Cfg1, Flags]], TransformerFlagsDsl[[Flags1]PartialTransformerDefinition[From, To, Cfg, Flags1], Flags], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PartialTransformerDefinition
  2. WithRuntimeDataStore
  3. TransformerDefinitionCommons
  4. TransformerFlagsDsl
  5. AnyRef
  6. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Instance Constructors

  1. new PartialTransformerDefinition(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. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. macro def buildTransformer[ImplicitScopeFlags <: TransformerFlags](implicit tc: TransformerConfiguration[ImplicitScopeFlags]): PartialTransformer[From, To]

    Build Partial Transformer using current configuration.

    Build Partial Transformer using current configuration.

    It runs macro that tries to derive instance of PartialTransformer[From, To]. When transformation can't be derived, it results with compilation error.

    returns

    io.scalaland.chimney.PartialTransformer type class instance

    Since

    0.7.0

  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. def disableBeanGetters: PartialTransformerDefinition[From, To, Cfg, Disable[BeanGetters, Flags]]

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

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

    Definition Classes
    TransformerFlagsDsl
    Since

    0.6.0

    See also

    https://chimney.readthedocs.io/supported-transformations/#reading-from-bean-getters for more details

  8. def disableBeanSetters: PartialTransformerDefinition[From, To, Cfg, Disable[BeanSetters, Flags]]

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

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

    Definition Classes
    TransformerFlagsDsl
    Since

    0.6.0

    See also

    https://chimney.readthedocs.io/supported-transformations/#writing-to-bean-setters for more details

  9. def disableDefaultValues: PartialTransformerDefinition[From, To, Cfg, 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
    TransformerFlagsDsl
    Since

    0.1.9

    See also

    https://chimney.readthedocs.io/supported-transformations/#allowing-fallback-to-the-constructors-default-values for more details

  10. def disableImplicitConflictResolution: PartialTransformerDefinition[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

  11. def disableInheritedAccessors: PartialTransformerDefinition[From, To, Cfg, Disable[InheritedAccessors, Flags]]

    Disable inherited accessors lookup that was previously enabled by enableInheritedAccessors

    Disable 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

  12. def disableMacrosLogging: PartialTransformerDefinition[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

  13. def disableMethodAccessors: PartialTransformerDefinition[From, To, Cfg, 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
    TransformerFlagsDsl
    Since

    0.5.0

    See also

    https://chimney.readthedocs.io/supported-transformations/#reading-from-methods for more details

  14. def disableOptionDefaultsToNone: PartialTransformerDefinition[From, To, Cfg, Disable[OptionDefaultsToNone, Flags]]

    Disable None fallback value for optional fields in To.

    Disable None fallback value for optional fields in To.

    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

  15. def enableBeanGetters: PartialTransformerDefinition[From, To, Cfg, 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
    TransformerFlagsDsl
    Since

    0.2.1

    See also

    https://chimney.readthedocs.io/supported-transformations/#reading-from-bean-getters for more details

  16. def enableBeanSetters: PartialTransformerDefinition[From, To, Cfg, 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
    TransformerFlagsDsl
    Since

    0.2.1

    See also

    https://chimney.readthedocs.io/supported-transformations/#writing-to-bean-setters for more details

  17. def enableDefaultValues: PartialTransformerDefinition[From, To, Cfg, 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
    TransformerFlagsDsl
    Since

    0.6.0

    See also

    https://chimney.readthedocs.io/supported-transformations/#allowing-fallback-to-the-constructors-default-values for more details

  18. def enableImplicitConflictResolution[P <: ImplicitTransformerPreference](preference: P): PartialTransformerDefinition[From, To, Cfg, 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
    TransformerFlagsDsl
    Since

    0.7.0

    See also

    https://chimney.readthedocs.io/supported-transformations/#resolving-priority-of-implicit-total-vs-partial-transformers for more details

  19. def enableInheritedAccessors: PartialTransformerDefinition[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

  20. def enableMacrosLogging: PartialTransformerDefinition[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

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

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

  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
    PartialTransformerDefinition → 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](f: (Inst) => To): PartialTransformerDefinition[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.PartialTransformerDefinition

    Since

    0.7.0

    See also

    for more details

  39. macro def withCoproductInstancePartial[Inst](f: (Inst) => Result[To]): PartialTransformerDefinition[From, To, _ <: TransformerCfg, Flags]

    Use f to calculate the (missing) coproduct instance partial result when mapping one coproduct into another.

    Use f to calculate the (missing) coproduct instance partial result 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.PartialTransformerDefinition

    Since

    0.7.0

    See also

    for more details

  40. macro def withFieldComputed[T, U](selector: (To) => T, f: (From) => U)(implicit ev: <:<[U, T]): PartialTransformerDefinition[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.PartialTransformerDefinition

    Since

    0.7.0

    See also

    https://chimney.readthedocs.io/supported-transformations/#wiring-the-constructors-parameter-to-computed-value for more details

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

    Use function f to compute partial result for field picked using selector.

    Use function f to compute partial result 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 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.PartialTransformerDefinition

    Since

    0.7.0

    See also

    https://chimney.readthedocs.io/supported-transformations/#wiring-the-constructors-parameter-to-computed-value for more details

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

    Use provided value for field picked using selector.

    Use provided value 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.PartialTransformerDefinition

    Since

    0.7.0

    See also

    https://chimney.readthedocs.io/supported-transformations/#wiring-the-constructors-parameter-to-a-provided-value for more details

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

    Use provided partial result value for field picked using selector.

    Use provided partial result value 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 computed value

    selector

    target field in To, defined like _.name

    value

    constant value to use for the target field

    returns

    io.scalaland.chimney.dsl.PartialTransformerDefinition

    Since

    0.7.0

    See also

    https://chimney.readthedocs.io/supported-transformations/#wiring-the-constructors-parameter-to-a-provided-value for more details

  44. macro def withFieldRenamed[T, U](selectorFrom: (From) => T, selectorTo: (To) => U): PartialTransformerDefinition[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.PartialTransformerDefinition

    Since

    0.7.0

    See also

    https://chimney.readthedocs.io/supported-transformations/#wiring-the-constructors-parameter-to-its-source-field for more details

Inherited from WithRuntimeDataStore

Inherited from TransformerDefinitionCommons[[Cfg1]PartialTransformerDefinition[From, To, Cfg1, Flags]]

Inherited from TransformerFlagsDsl[[Flags1]PartialTransformerDefinition[From, To, Cfg, Flags1], Flags]

Inherited from AnyRef

Inherited from Any

Ungrouped