ValueClassesPlatform
io.scalaland.chimney.internal.compiletime.datatypes.ValueClassesPlatform
trait ValueClassesPlatform extends ValueClasses
Attributes
- Graph
-
- Supertypes
- Self type
Members list
Type members
Classlikes
protected object WrapperClassType extends WrapperClassTypeModule
Attributes
- Supertypes
- Self type
-
WrapperClassType.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 Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Inherited from:
- ValueClasses
- Supertypes
-
class Objecttrait Matchableclass 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 Serializabletrait Producttrait Equalsclass Objecttrait Matchableclass AnyShow all
Attributes
- Inherited from:
- ValueClasses
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
object WrapperClassType.type
In this article