ValueClasses

io.scalaland.chimney.internal.compiletime.datatypes.ValueClasses
trait ValueClasses

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
Self type

Members list

Type members

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

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
protected object ValueClassType

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
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

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
protected trait WrapperClassTypeModule

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object WrapperClassType.type
Self type

Value members

Abstract fields