CaseClassUtils

org.encalmo.utils.CaseClassUtils

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def collect[In](valueExpr: Expr[In], functionExpr: [A] => (x$1: Expr[String], x$2: Expr[A], x$3: Set[AnnotationInfo]) => Type[A] ?=> Expr[Any])(using evidence$1: Type[In], quotes: Quotes): Expr[Unit]

Visit a case class and apply a function to each field, then collect the results into a block of unit.

Visit a case class and apply a function to each field, then collect the results into a block of unit.

Attributes

Returns

Unit

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 transformToExprOfTuple[In](valueExpr: Expr[In], functionExpr: [A] => (x$1: Expr[String], x$2: Expr[A], x$3: Set[AnnotationInfo]) => Type[A] ?=> Option[Expr[Any]])(using evidence$1: Type[In], quotes: Quotes): Expr[Tuple]

Transform a case class into an expression of tuple of output values returned by the provided function. Filter out returned values that are None.

Transform a case class into an expression of tuple of output values returned by the provided function. Filter out returned values that are None.

Value parameters

function

The function to apply to each field.

value

The instance of the case class to transform.

Attributes

Returns

A list of output values.

def transformToList[In, Out](valueExpr: Expr[In], functionExpr: [A] => (x$1: Expr[String], x$2: Expr[A], x$3: Set[AnnotationInfo]) => Type[A] ?=> Option[Out])(using evidence$1: Type[In], quotes: Quotes): List[Out]

Transform a case class into a list of output values returned by the provided function. Filter out returned values that are None.

Transform a case class into a list of output values returned by the provided function. Filter out returned values that are None.

Value parameters

function

The function to apply to each field.

value

The instance of the case class to transform.

Attributes

Returns

A list of output values.

def transformToListOfExpr[In, Out](valueExpr: Expr[In], functionExpr: [A] => (x$1: Expr[String], x$2: Expr[A], x$3: Set[AnnotationInfo]) => Type[A] ?=> Option[Expr[Out]])(using evidence$1: Type[In], evidence$2: Type[Out], quotes: Quotes): List[Expr[Out]]

Transform a case class into a list of output values returned by the provided function. Filter out returned values that are None.

Transform a case class into a list of output values returned by the provided function. Filter out returned values that are None.

Value parameters

function

The function to apply to each field.

value

The instance of the case class to transform.

Attributes

Returns

A list of output values.

def transformToTuple[In](valueExpr: Expr[In], functionExpr: [A] => (x$1: Expr[String], x$2: Expr[A], x$3: Set[AnnotationInfo]) => Type[A] ?=> Option[Any])(using evidence$1: Type[In], quotes: Quotes): Tuple

Transform a case class into a tuple of output values returned by the provided function. Filter out returned values that are None.

Transform a case class into a tuple of output values returned by the provided function. Filter out returned values that are None.

Value parameters

function

The function to apply to each field.

value

The instance of the case class to transform.

Attributes

Returns

A list of output values.

def visit[In : Type](using cache: StatementsCache)(valueTerm: cache.quotes.reflect.Term, functionExpr: [A] => (x$1: String, x$2: cache.quotes.reflect.Term, x$3: Set[AnnotationInfo]) => Type[A] ?=> 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