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<String> getTargetSurface()
      Returns:
      For a reference field: where the target lives — record, document, user, or the name of an identity namespace (org, client, or one you registered, such as team). 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.
    • 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()