ValueClassesPlatform

io.scalaland.chimney.internal.compiletime.datatypes.ValueClassesPlatform

Attributes

Graph
Supertypes
trait ValueClasses
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

protected object WrapperClassType extends WrapperClassTypeModule

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Inherited classlikes

final protected case class ValueClass[Outer, Inner](fieldName: String, unwrap: (Expr[Outer]) => Expr[Inner], wrap: (Expr[Inner]) => Expr[Outer])

Let us unwrap and wrap value in AnyVal value class

Let us unwrap and wrap value in AnyVal value class

Attributes

Inherited from:
ValueClasses
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
protected object ValueClassType

Attributes

Inherited from:
ValueClasses
Supertypes
class Object
trait Matchable
class Any
final protected case class WrapperClass[Outer, Inner](fieldName: String, unwrap: (Expr[Outer]) => Expr[Inner], wrap: (Expr[Inner]) => Expr[Outer])

Let us unwrap and wrap value in any class that wraps a single value (not only AnyVals)

Let us unwrap and wrap value in any class that wraps a single value (not only AnyVals)

For a class to be considered wrapper it has to:

  • have a public unary constructor
  • expose a getter of the same name and type as constructor's argument

Basically, it is a value class without the need to extends AnyVal. This is useful since sometimes we have a type which is basically a wrapper but not an AnyVal and we would like to unwrap it and attempt to derive code as if it was AnyVal. Since it is very contextual, we need to have a separate utility for that.

Attributes

Inherited from:
ValueClasses
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
protected trait WrapperClassTypeModule

Attributes

Inherited from:
ValueClasses
Supertypes
class Object
trait Matchable
class Any
Known subtypes