Field

zio.blocks.codegen.ir.Field
final case class Field(name: String, typeRef: TypeRef, defaultValue: Option[String] = ..., annotations: List[Annotation] = ..., doc: Option[String] = ...)

Represents a field/property in the IR, with type, default value, annotations, and documentation.

Value parameters

annotations

List of annotations on the field (defaults to empty list)

defaultValue

Optional default value for the field as a string (defaults to None)

doc

Optional documentation/description of the field (defaults to None)

name

The name of the field

typeRef

The type of the field

Attributes

Example
// Simple field
val nameField = Field("name", TypeRef.String)
// Field with default value
val ageField = Field("age", TypeRef.Int, Some("0"))
// Field with annotations and documentation
val emailField = Field(
 "email",
 TypeRef.String,
 annotations = List(Annotation("required")),
 doc = Some("User email address")
)
// Field with complex type
val itemsField = Field("items", TypeRef.list(TypeRef.String))
Source
Field.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