Class

io.scalaland.chimney.dsl

TransformerInto

Related Doc: package dsl

Permalink

final class TransformerInto[From, To, C <: TransformerCfg] extends ConfigDsl[[C1]TransformerInto[From, To, C1], C]

Provides DSL for configuring io.scalaland.chimney.Transformer'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

Linear Supertypes
ConfigDsl[[C1]TransformerInto[From, To, C1], C], AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. TransformerInto
  2. ConfigDsl
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new TransformerInto(source: From, td: TransformerDefinition[From, To, C])

    Permalink

    source

    object to transform

    td

    transformer definition

Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def __refineTransformerDefinition[C1 <: TransformerCfg](f: (TransformerDefinition[From, To, C]) ⇒ TransformerDefinition[From, To, C1]): TransformerInto[From, To, C1]

    Permalink

    Used internally by macro.

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

  5. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  6. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate() @throws( ... )
  7. def disableDefaultValues: TransformerInto[From, To, DisableDefaultValues[C]]

    Permalink

    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.

    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

  8. def enableBeanGetters: TransformerInto[From, To, EnableBeanGetters[C]]

    Permalink

    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
    ConfigDsl
    See also

    https://scalalandio.github.io/chimney/transformers/java-beans.html#reading-from-java-beans for more details

  9. def enableBeanSetters: TransformerInto[From, To, EnableBeanSetters[C]]

    Permalink

    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
    ConfigDsl
    See also

    https://scalalandio.github.io/chimney/transformers/java-beans.html#writing-to-java-beans for more details

  10. def enableMethodAccessors: TransformerInto[From, To, EnableMethodAccessors[C]]

    Permalink

    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

  11. def enableOptionDefaultsToNone: TransformerInto[From, To, EnableOptionDefaultsToNone[C]]

    Permalink

    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

  12. def enableUnsafeOption: TransformerInto[From, To, EnableUnsafeOption[C]]

    Permalink

    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
    ConfigDsl
    See also

    https://scalalandio.github.io/chimney/transformers/unsafe-options.html for more details

  13. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  14. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  15. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  16. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
    Annotations
    @HotSpotIntrinsicCandidate()
  17. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  18. def lift[F[+_]]: TransformerFInto[F, From, To, WrapperType[F, C]]

    Permalink

    Lifts current transformation with provided type constructor F.

    Lifts current transformation with provided type constructor F.

    It keeps all the configuration, provided missing values, renames, coproduct instances etc.

    F

    wrapper type constructor

    returns

    io.scalaland.chimney.dsl.TransformerFInto

  19. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  20. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  21. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @HotSpotIntrinsicCandidate()
  22. val source: From

    Permalink

    object to transform

  23. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  24. val td: TransformerDefinition[From, To, C]

    Permalink

    transformer definition

  25. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  26. macro def transform: To

    Permalink

    Apply configured transformation in-place.

    Apply configured transformation in-place.

    It runs macro that tries to derive instance of Transformer[From, To] and immediately apply it to captured source value. When transformation can't be derived, it results with compilation error.

    returns

    transformed value of type To

  27. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  29. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  30. macro def withCoproductInstance[Inst](f: (Inst) ⇒ To): TransformerInto[From, To, _ <: TransformerCfg]

    Permalink

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

    f

    function to calculate values of components that cannot be mapped automatically

    returns

    io.scalaland.chimney.dsl.TransformerInto

    See also

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

  31. macro def withCoproductInstanceF[F[+_], Inst](f: (Inst) ⇒ F[To]): TransformerFInto[F, From, To, _ <: TransformerCfg]

    Permalink

    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.

    f

    function to calculate values of components that cannot be mapped automatically

    returns

    io.scalaland.chimney.dsl.TransformerFInto

    See also

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

  32. macro def withFieldComputed[T, U](selector: (To) ⇒ T, map: (From) ⇒ U): TransformerInto[From, To, _ <: TransformerCfg]

    Permalink

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

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

    By default if From is missing field picked by selector compilation fails.

    selector

    target field in To, defined like _.name

    map

    function used to compute value of the target field

    returns

    io.scalaland.chimney.dsl.TransformerInto

    See also

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

  33. macro def withFieldComputedF[F[+_], T, U](selector: (To) ⇒ T, map: (From) ⇒ F[U]): TransformerFInto[F, From, To, _ <: TransformerCfg]

    Permalink

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

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

    By default if From is missing field picked by selector compilation fails.

    selector

    target field in To, defined like _.name

    map

    function used to compute value of the target field

    returns

    io.scalaland.chimney.dsl.TransformerFInto

    See also

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

  34. macro def withFieldConst[T, U](selector: (To) ⇒ T, value: U): TransformerInto[From, To, _ <: TransformerCfg]

    Permalink

    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.

    returns

    io.scalaland.chimney.dsl.TransformerInto

    See also

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

  35. macro def withFieldConstF[F[+_], T, U](selector: (To) ⇒ T, value: F[U]): TransformerFInto[F, From, To, _ <: TransformerCfg]

    Permalink

    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.

    selector

    target field in To, defined like _.name

    value

    constant value to use for the target field

    returns

    io.scalaland.chimney.dsl.TransformerFInto

    See also

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

  36. macro def withFieldRenamed[T, U](selectorFrom: (From) ⇒ T, selectorTo: (To) ⇒ U): TransformerInto[From, To, _ <: TransformerCfg]

    Permalink

    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.

    selectorFrom

    source field in From, defined like _.originalName

    selectorTo

    target field in To, defined like _.newName

    returns

    io.scalaland.chimney.dsl.TransformerInto

    See also

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

Deprecated Value Members

  1. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @Deprecated @deprecated @throws( classOf[java.lang.Throwable] )
    Deprecated

    (Since version ) see corresponding Javadoc for more information.

Inherited from ConfigDsl[[C1]TransformerInto[From, To, C1], C]

Inherited from AnyRef

Inherited from Any

Ungrouped