CaseClassUtils

org.encalmo.utils.CaseClassUtils

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Value members

Concrete methods

def createInstanceFromTuple[R <: Product : Type](using Quotes)(tuple: Expr[Tuple]): Expr[R]

Create an instance of a case class using a tuple.

Create an instance of a case class using a tuple.

Value parameters

tuple

The tuple to pass to the constructor.

Attributes

Returns

An instance of the case class.

def createInstanceUsingConstructor[R <: Product : Type](using Quotes)(args: List[x$1.reflect.Term]): Expr[R]

Create an instance of a case class using its primary constructor.

Create an instance of a case class using its primary constructor.

Value parameters

args

The arguments to pass to the constructor.

Attributes

Returns

An instance of the case class.

def isCaseClass[A](using evidence$1: Type[A], Quotes): Boolean

Check if a type is a case class.

Check if a type is a case class.

Attributes

def visit(using cache: StatementsCache)(tpe: cache.quotes.reflect.TypeRepr, valueTerm: cache.quotes.reflect.Term, functionOnField: (cache.quotes.reflect.TypeRepr, String, cache.quotes.reflect.Term, Set[AnnotationInfo]) => Unit): Unit

Visit a case class and apply a function to each field using a statements cache.

Visit a case class and apply a function to each field using a statements cache.

Attributes

Returns

Unit

def visitTermless(using cache: StatementsCache)(tpe: cache.quotes.reflect.TypeRepr, functionOnField: (cache.quotes.reflect.TypeRepr, String, Set[AnnotationInfo]) => Unit): Unit

Visit a case class and apply a function to each field using a statements cache without the value term.

Visit a case class and apply a function to each field using a statements cache without the value term.

Value parameters

cache

implicit statements cache to store the generated code

functionOnField

the function to apply to each field

tpe

the type of the case class

Attributes

Returns

Unit