c

io.scalaland.chimney.dsl

PartialTransformerInto

final class PartialTransformerInto[From, To, C <: TransformerCfg, Flags <: TransformerFlags] extends FlagsDsl[[F1]PartialTransformerInto[From, To, C, F1], Flags]

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

C

type-level encoded config

Flags

type-level encoded flags

Since

0.7.0

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

Instance Constructors

  1. new PartialTransformerInto(source: From, td: PartialTransformerDefinition[From, To, C, Flags])

    source

    object to transform

    td

    transformer definition

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 __refineTransformerDefinition[C1 <: TransformerCfg](f: (PartialTransformerDefinition[From, To, C, Flags]) => PartialTransformerDefinition[From, To, C1, Flags]): PartialTransformerInto[From, To, C1, Flags]

    Used internally by macro.

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

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.CloneNotSupportedException]) @native()
  7. def disableBeanGetters: PartialTransformerInto[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

  8. def disableBeanSetters: PartialTransformerInto[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

  9. def disableDefaultValues: PartialTransformerInto[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

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

  11. def disableMethodAccessors: PartialTransformerInto[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

  12. def disableOptionDefaultsToNone: PartialTransformerInto[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

  13. def enableBeanGetters: PartialTransformerInto[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

  14. def enableBeanSetters: PartialTransformerInto[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

  15. def enableDefaultValues: PartialTransformerInto[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

  16. def enableImplicitConflictResolution[P <: ImplicitTransformerPreference](preference: P): PartialTransformerInto[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

  17. def enableMethodAccessors: PartialTransformerInto[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

  18. def enableOptionDefaultsToNone: PartialTransformerInto[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

  19. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. def equals(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef → Any
  21. def finalize(): Unit
    Attributes
    protected[lang]
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.Throwable])
  22. final def getClass(): Class[_ <: AnyRef]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  23. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  24. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  25. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  26. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  27. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  28. val source: From
  29. final def synchronized[T0](arg0: => T0): T0
    Definition Classes
    AnyRef
  30. val td: PartialTransformerDefinition[From, To, C, Flags]
  31. def toString(): String
    Definition Classes
    AnyRef → Any
  32. macro def transform[ScopeFlags <: TransformerFlags](implicit tc: TransformerConfiguration[ScopeFlags]): 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 captured source value. When transformation can't be derived, it results with compilation error.

    returns

    partial transformation result of type partial.Result[To]

    Since

    0.7.0

  33. macro def transformFailFast[ScopeFlags <: TransformerFlags](implicit tc: TransformerConfiguration[ScopeFlags]): 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 captured source value. When transformation can't be derived, it results with compilation error.

    returns

    partial transformation result of type partial.Result[To]

    Since

    0.7.0

  34. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  35. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException])
  36. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws(classOf[java.lang.InterruptedException]) @native()
  37. macro def withCoproductInstance[Inst](f: (Inst) => To): PartialTransformerInto[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.PartialTransformerInto

    Since

    0.7.0

    See also

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

  38. macro def withCoproductInstancePartial[Inst](f: (Inst) => Result[To]): PartialTransformerInto[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.PartialTransformerInto

    Since

    0.7.0

    See also

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

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

    Since

    0.7.0

    See also

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

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

    Since

    0.7.0

    See also

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

  41. macro def withFieldConst[T, U](selector: (To) => T, value: U)(implicit ev: <:<[U, T]): PartialTransformerInto[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.PartialTransformerInto

    Since

    0.7.0

    See also

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

  42. macro def withFieldConstPartial[T, U](selector: (To) => T, value: Result[U])(implicit ev: <:<[U, T]): PartialTransformerInto[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 provided value

    selector

    target field in To, defined like _.name

    value

    constant value to use for the target field

    returns

    io.scalaland.chimney.dsl.PartialTransformerInto

    Since

    0.7.0

    See also

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

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

    Since

    0.7.0

    See also

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

Deprecated Value Members

  1. def disableUnsafeOption: PartialTransformerInto[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: PartialTransformerInto[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 FlagsDsl[[F1]PartialTransformerInto[From, To, C, F1], Flags]

Inherited from AnyRef

Inherited from Any

Ungrouped