Class FieldDef.Builder
- All Implemented Interfaces:
FieldDef._FinalStage,FieldDef.FieldIdStage,FieldDef.FieldTypeStage
- Enclosing class:
FieldDef
-
Method Summary
Modifier and TypeMethodDescriptionadditionalProperties(Map<String, Object> additionalProperties) additionalProperty(String key, Object value) build()cardinality(String cardinality) For areferencefield:one(a single id, the default) ormany(an array of ids).cardinality(Optional<String> cardinality) For areferencefield:one(a single id, the default) ormany(an array of ids).description(String description) Human-readable description of the field.description(Optional<String> description) Human-readable description of the field.enumValues(List<Map<String, Object>> enumValues) The set of allowed values, for an enum-type field.The set of allowed values, for an enum-type field.Unique identifier for this field within the schema.fieldType(@NotNull FieldDefFieldType fieldType) Data type of the field.filterable(Boolean filterable) Whether this field can be used as a filter in queries.filterable(Optional<Boolean> filterable) Whether this field can be used as a filter in queries.Whether this field is required when a record is created.Whether this field is required when a record is created.searchable(Boolean searchable) Whether this field's value contributes to full-text search.searchable(Optional<Boolean> searchable) Whether this field's value contributes to full-text search.Marks the field as sensitive (PHI/PII).Marks the field as sensitive (PHI/PII).targetField(String targetField) For areferencefield: the target's lookup field to resolve against.targetField(Optional<String> targetField) For areferencefield: the target's lookup field to resolve against.targetSurface(String targetSurface) For areferencefield: where the target lives —record,document,user, or the name of an identity namespace (org,client, or one you registered, such asteam).targetSurface(Optional<String> targetSurface) For areferencefield: where the target lives —record,document,user, or the name of an identity namespace (org,client, or one you registered, such asteam).targetTypeName(String targetTypeName) For areferencefield: the target type this field points at.targetTypeName(Optional<String> targetTypeName) For areferencefield: the target type this field points at.validation(Map<String, Object> validation) Validation rules for this field's value (such as minimum/maximum length or a regex pattern).validation(Optional<Map<String, Object>> validation) Validation rules for this field's value (such as minimum/maximum length or a regex pattern).
-
Method Details
-
from
- Specified by:
fromin interfaceFieldDef.FieldIdStage
-
fieldId
Unique identifier for this field within the schema.
Unique identifier for this field within the schema.
- Specified by:
fieldIdin interfaceFieldDef.FieldIdStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
fieldType
Data type of the field. Use
referencefor a foreign-key field that points at another type — then settargetTypeName,targetField,targetSurface, andcardinalitybelow.Data type of the field. Use
referencefor a foreign-key field that points at another type — then settargetTypeName,targetField,targetSurface, andcardinalitybelow.- Specified by:
fieldTypein interfaceFieldDef.FieldTypeStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
sensitive
Marks the field as sensitive (PHI/PII). Sensitive fields are redacted in logs, audit trails, and errors; blind-indexed for lookups; excluded from search; and masked in responses unless the token carries the
sreveal scope for this record type.- Specified by:
sensitivein interfaceFieldDef._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
sensitive
Marks the field as sensitive (PHI/PII). Sensitive fields are redacted in logs, audit trails, and errors; blind-indexed for lookups; excluded from search; and masked in responses unless the token carries the
sreveal scope for this record type.- Specified by:
sensitivein interfaceFieldDef._FinalStage
-
targetSurface
For a
referencefield: where the target lives —record,document,user, or the name of an identity namespace (org,client, or one you registered, such asteam). Required for reference fields. The same type name can exist in more than one place, so this disambiguates which lookup resolves the reference. A namespace must already be registered and entity-backed, otherwise the schema is rejected — a reference that could never resolve fails when you define it, not on every write.- Specified by:
targetSurfacein interfaceFieldDef._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
targetSurface
For a
referencefield: where the target lives —record,document,user, or the name of an identity namespace (org,client, or one you registered, such asteam). Required for reference fields. The same type name can exist in more than one place, so this disambiguates which lookup resolves the reference. A namespace must already be registered and entity-backed, otherwise the schema is rejected — a reference that could never resolve fails when you define it, not on every write.- Specified by:
targetSurfacein interfaceFieldDef._FinalStage
-
cardinality
For a
referencefield:one(a single id, the default) ormany(an array of ids).- Specified by:
cardinalityin interfaceFieldDef._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
cardinality
For a
referencefield:one(a single id, the default) ormany(an array of ids).- Specified by:
cardinalityin interfaceFieldDef._FinalStage
-
targetField
For a
referencefield: the target's lookup field to resolve against. Defaults toexternalId, and must name a unique lookup on the target type.- Specified by:
targetFieldin interfaceFieldDef._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
targetField
For a
referencefield: the target's lookup field to resolve against. Defaults toexternalId, and must name a unique lookup on the target type.- Specified by:
targetFieldin interfaceFieldDef._FinalStage
-
targetTypeName
For a
referencefield: the target type this field points at. Required for reference fields.- Specified by:
targetTypeNamein interfaceFieldDef._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
targetTypeName
For a
referencefield: the target type this field points at. Required for reference fields.- Specified by:
targetTypeNamein interfaceFieldDef._FinalStage
-
enumValues
The set of allowed values, for an enum-type field.
- Specified by:
enumValuesin interfaceFieldDef._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
enumValues
The set of allowed values, for an enum-type field.
- Specified by:
enumValuesin interfaceFieldDef._FinalStage
-
validation
Validation rules for this field's value (such as minimum/maximum length or a regex pattern).
- Specified by:
validationin interfaceFieldDef._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
validation
Validation rules for this field's value (such as minimum/maximum length or a regex pattern).
- Specified by:
validationin interfaceFieldDef._FinalStage
-
description
Human-readable description of the field.
- Specified by:
descriptionin interfaceFieldDef._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
description
Human-readable description of the field.
- Specified by:
descriptionin interfaceFieldDef._FinalStage
-
filterable
Whether this field can be used as a filter in queries.
- Specified by:
filterablein interfaceFieldDef._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
filterable
Whether this field can be used as a filter in queries.
- Specified by:
filterablein interfaceFieldDef._FinalStage
-
searchable
Whether this field's value contributes to full-text search.
- Specified by:
searchablein interfaceFieldDef._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
searchable
Whether this field's value contributes to full-text search.
- Specified by:
searchablein interfaceFieldDef._FinalStage
-
required
Whether this field is required when a record is created.
- Specified by:
requiredin interfaceFieldDef._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
required
Whether this field is required when a record is created.
- Specified by:
requiredin interfaceFieldDef._FinalStage
-
build
- Specified by:
buildin interfaceFieldDef._FinalStage
-
additionalProperty
- Specified by:
additionalPropertyin interfaceFieldDef._FinalStage
-
additionalProperties
- Specified by:
additionalPropertiesin interfaceFieldDef._FinalStage
-