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
Members list
In this article