WrapperClass

io.scalaland.chimney.internal.compiletime.datatypes.ValueClasses.WrapperClass
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)

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

Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product