Class FieldDef

java.lang.Object
ai.vectros.types.FieldDef

public final class FieldDef extends Object
  • Method Details

    • getFieldId

      public String getFieldId()
      Returns:
      Unique identifier for this field within the schema.
    • getFieldType

      public FieldDefFieldType getFieldType()
      Returns:
      Data type of the field. Use reference for a foreign-key field that points at another type — then set targetTypeName, targetField, targetSurface, and cardinality below.
    • getRequired

      public Optional<Boolean> getRequired()
      Returns:
      Whether this field is required when a record is created.
    • getSearchable

      public Optional<Boolean> getSearchable()
      Returns:
      Whether this field's value contributes to full-text search.
    • getFilterable

      public Optional<Boolean> getFilterable()
      Returns:
      Whether this field can be used as a filter in queries.
    • getDescription

      public Optional<String> getDescription()
      Returns:
      Human-readable description of the field.
    • getValidation

      public Optional<Map<String,Object>> getValidation()
      Returns:
      Validation rules for this field's value (such as minimum/maximum length or a regex pattern).
    • getEnumValues

      public Optional<List<Map<String,Object>>> getEnumValues()
      Returns:
      The set of allowed values, for an enum-type field.
    • getTargetTypeName

      public Optional<String> getTargetTypeName()
      Returns:
      For a reference field: the target type this field points at. Required for reference fields.
    • getTargetField

      public Optional<String> getTargetField()
      Returns:
      For a reference field: the target's lookup field to resolve against. Defaults to externalId, and must name a unique lookup on the target type.
    • getCardinality

      public Optional<String> getCardinality()
      Returns:
      For a reference field: one (a single id, the default) or many (an array of ids).
    • getTargetSurface

      public Optional<FieldDefTargetSurface> getTargetSurface()
      Returns:
      For a reference field: which surface the target lives on — record, document, user, org, or client. Required for reference fields. The same type name can exist on more than one surface, so this disambiguates which lookup resolves the reference.
    • getSensitive

      public Optional<Boolean> getSensitive()
      Returns:
      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 s reveal scope for this record type.
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • getAdditionalProperties

      public Map<String,Object> getAdditionalProperties()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • builder

      public static FieldDef.FieldIdStage builder()