Interface Field

All Superinterfaces:
Named, ScalarTyped, TokenTyped
All Known Subinterfaces:
BinaryInputField, BinaryOutputField, BooleanInputField, BooleanOutputField, CharInputField, CharOutputField, DateInputField, DateOutputField, DoubleInputField, DoubleOutputField, DurationInputField, DurationOutputField, FloatInputField, FloatOutputField, IntInputField, IntOutputField, Ip4AddressInputField, Ip4AddressOutputField, Ip6AddressInputField, Ip6AddressOutputField, JDBCField, LongInputField, LongOutputField, MoneyInputField, MoneyOutputField, NumberOutputField, NumericInputField, NumericOutputField, ObjectInputField<T>, ObjectOutputField<T>, PeriodInputField, PeriodOutputField, ScalarInputField, ScalarOutputField, StringInputField, StringOutputField, TimeInputField, TimeOutputField, TimestampInputField, TimestampOutputField

public interface Field extends Named, ScalarTyped
An element of a RecordTokenType schema.

All record types have a schema, comprised of zero or more Field objects, which describes the structure of the record type. Every Field has both a name and a type. A Field is uniquely identified by name within the containing schema's context.

  • Method Details

    • getName

      String getName()
      Gets the name of the field.
      Specified by:
      getName in interface Named
      Returns:
      the field name
    • getType

      ScalarTokenType getType()
      Gets the token type of the field.
      Specified by:
      getType in interface ScalarTyped
      Specified by:
      getType in interface TokenTyped
      Returns:
      the field type
    • getProperties

      Map<String,String> getProperties()
      Returns a map of key-value pairs associated with this field. The returned map will always be immutable.
      Returns:
      a map of key-value pairs associated with this field.
    • getDomain

      FieldDomain getDomain()
      Returns the domain of this field. This will never be null but may be FieldDomain.UNSPECIFIED.
      Returns:
      the domain of this field
    • isPrimaryKey

      boolean isPrimaryKey()
      Returns whether this field is the primary key of the record. In order to be a primary key, the field must be of Comparable type and must be unique within the record. Note that the framework will not make any attempt to enforce uniqueness; rather this is purely a declaration. Finally, a given record may have at most one primary key.
      Returns:
      whether this field is the primary key of the record