io.scalaland.chimney

Members list

Type members

Classlikes

final case class Codec[Domain, Dto](encode: Transformer[Domain, Dto], decode: PartialTransformer[Dto, Domain])

Type class representing bidirectional conversion from the type that can be always converted (total transformation), usually the domain model, into type that has to be validated when converting back (partial transformation), usually the DTO model.

Type class representing bidirectional conversion from the type that can be always converted (total transformation), usually the domain model, into type that has to be validated when converting back (partial transformation), usually the DTO model.

Type parameters

Domain

type of the domain value

Dto

typeof the DTO value

Value parameters

decode

conversion from DTO to domain model which can fail

encode

conversion from domain model to DTO which is guaranteed to succeed

Attributes

See also
Since

1.2.0

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Codec

Attributes

See also
Since

1.2.0

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Codec.type
final case class Iso[First, Second](first: Transformer[First, Second], second: Transformer[Second, First])

Type class representing bidirectional conversion between isomorphic types, where conversion in each can always succeed (total transformation).

Type class representing bidirectional conversion between isomorphic types, where conversion in each can always succeed (total transformation).

Type parameters

First

input type of the first conversion, output type of the second conversion

Second

output type of the first conversion, input type of the second conversion

Value parameters

first

conversion the first type into the second type

second

conversion the second type into the first type

Attributes

See also
Since

1.2.0

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Iso

Companion of io.scalaland.chimney.Iso.

Companion of io.scalaland.chimney.Iso.

Attributes

See also
Since

1.2.0

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Iso.type
@FunctionalInterface
trait PartialTransformer[From, To] extends AutoDerived[From, To]

Type class expressing partial transformation between source type From and target type To, with the ability of reporting path-annotated transformation error(s).

Type class expressing partial transformation between source type From and target type To, with the ability of reporting path-annotated transformation error(s).

Type parameters

From

type of input value

To

type of output value

Attributes

See also
Since

0.7.0

Note

You should not need to instantiate this class manually, if you can derive it - take a look at io.scalaland.chimney.PartialTransformer.derive and io.scalaland.chimney.PartialTransformer.define methods for that. Manual intantiation is only necessary if you want to add support for the transformation that is not supported out of the box. Even then consult https://chimney.readthedocs.io/cookbook/#integrations first!

Companion
object
Supertypes
trait AutoDerived[From, To]
class Object
trait Matchable
class Any
@FunctionalInterface
trait Patcher[A, Patch] extends AutoDerived[A, Patch]

Type class definition that wraps patching behavior.

Type class definition that wraps patching behavior.

Type parameters

A

type of object to apply patch to

Patch

type of patch object

Attributes

See also
Since

0.1.3

Note

You should not need to instantiate this class manually, if you can derive it - take a look at io.scalaland.chimney.Patcher.derive and io.scalaland.chimney.Patcher.define methods for that. Manual intantiation is only necessary if you want to add support for the transformation that is not supported out of the box. Even then consult https://chimney.readthedocs.io/cookbook/#integrations first!

Companion
object
Supertypes
trait AutoDerived[A, Patch]
class Object
trait Matchable
class Any
object Patcher

Attributes

See also
Since

0.1.3

Companion
trait
Supertypes
class Object
trait Matchable
class Any
Self type
Patcher.type
@FunctionalInterface
trait Transformer[From, To] extends AutoDerived[From, To]

Type class expressing total transformation between source type From and target type To.

Type class expressing total transformation between source type From and target type To.

Type parameters

From

type of input value

To

type of output value

Attributes

See also
Since

0.1.0

Note

You should not need to instantiate this class manually, if you can derive it - take a look at io.scalaland.chimney.Transformer.derive and io.scalaland.chimney.Transformer.define methods for that. Manual intantiation is only necessary if you want to add support for the transformation that is not supported out of the box. Even then consult https://chimney.readthedocs.io/cookbook/#integrations first!

Companion
object
Supertypes
trait AutoDerived[From, To]
class Object
trait Matchable
class Any
object auto

Imports only automatic derivation implicits

Imports only automatic derivation implicits

Attributes

Since

0.8.0

Supertypes
class Object
trait Matchable
class Any
Self type
auto.type