CaseClass

zio.blocks.codegen.ir.CaseClass
final case class CaseClass(name: String, fields: List[Field], typeParams: List[TypeParam] = ..., extendsTypes: List[TypeRef] = ..., derives: List[String] = ..., annotations: List[Annotation] = ..., companion: Option[CompanionObject] = ..., doc: Option[String] = ..., isValueClass: Boolean = ...) extends TypeDefinition

Represents a Scala case class in the IR.

Value parameters

annotations

Annotations on the case class (defaults to empty list)

companion

Optional companion object (defaults to None)

derives

Type class derivations (defaults to empty list)

doc

Optional documentation (defaults to None)

extendsTypes

Types that this case class extends (defaults to empty list)

fields

The fields (constructor parameters) of the case class

name

The name of the case class

typeParams

Type parameters for generic case classes (defaults to empty list)

Attributes

Example
val person = CaseClass(
 "Person",
 fields = List(
   Field("name", TypeRef.String),
   Field("age", TypeRef.Int)
 ),
 derives = List("Schema")
)
Source
TypeDefinition.scala
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]

An iterator over the names of all the elements of this product.

An iterator over the names of all the elements of this product.

Attributes

Inherited from:
Product
Source
Product.scala
def productIterator: Iterator[Any]

An iterator over all the elements of this product.

An iterator over all the elements of this product.

Attributes

Returns

in the default implementation, an Iterator[Any]

Inherited from:
Product
Source
Product.scala