Package com.qfs.desc

Interface IFieldDescription

All Known Subinterfaces:
IVectorFieldDescription
All Known Implementing Classes:
FieldDescription, VectorFieldDescription

public interface IFieldDescription
Description of a field in a store of the Datastore.
Author:
ActiveViam
  • Method Details

    • getName

      String getName()
      Indicates the name of the field. If null or empty a ConfigurationException will be thrown when attempting to build an IDatastore using this field.
      Returns:
      the name of the field
    • getDataType

      String getDataType()
      Indicates the data type of the field. Can be one of LiteralType optionally followed by brackets ([]) for array types.
      Returns:
      the type of the field
    • isNullable

      boolean isNullable()
      Indicates whether this field supports null values. If set to false, null values will be replaced by getDefault(). See getDefault().

      Some ISelectionListener like ActivePivot can add the constraint that some fields are non-nullable because the listener does not handle null values on some fields of the records they receive.

      Returns:
      true if the field can have a null value, false otherwise
    • canBeEmptyString

      @DeprecatedApi(forRemoval="6.1.0", rationale="Use IFieldDescription#supportEmptyString() instead") boolean canBeEmptyString()
      Indicates whether this field supports empty String as value.

      When writing empty String to a field that rejects it, it will be automatically replaced by the default value.

      Some components like ActivePivot can add the constraint that some fields do not accept empty String because they cannot handle such value.

      Returns:
      true if the field supports empty String, false otherwise
    • supportEmptyString

      default boolean supportEmptyString()
      Indicates whether this field supports empty String as value.

      When writing empty String to a field that rejects it, it will be automatically replaced by the default value.

      Some components like ActivePivot can add the constraint that some fields do not accept empty String because they cannot handle such value.

      Returns:
      true if the field supports empty String, false otherwise
    • isDictionarized

      boolean isDictionarized()
      Indicates whether the field will be dictionarized.

      This means that the physical values stored for this field will be integer values, provided by an IDictionary for each of the initial values of this value.

      This can reduce the memory usage in most of the cases.

      Returns:
      true if dictionarized, false otherwise
    • getDefault

      Object getDefault()
      Gets the default value for this field.

      The default value is used at insertion time to replace the value of the inserted records if they are null for this field.

      In queries and continuous selections, the records sent to the IPartitionedResultAcceptor or ISelectionListener can contain null fields if the path used to retrieve this field used references that could not be resolved. In this case the value in the record will be the default value defined here.

      If this methods returns null and the isNullable() is false, a default value is imposed, depending on getDataType(), see global constants. If getDataType() indicates an array type, no default value will be imposed and if isNullable() is false, a ConfigurationException will be thrown when an IDatastore is built with this description.

      The type of the returned Object must be consistent with getDataType(), otherwise a ConfigurationException will be thrown when an IDatastore is built with this description.

      Returns:
      the default value for this field
    • getContentClass

      Class<?> getContentClass()
      Gets the class this field represents.
      Returns:
      the class this field represents
    • getAllocationSettings

      IAllocationSettings getAllocationSettings()
      Gets the settings configuring the allocation strategy for storing this field.
      Returns:
      defined settings
    • getLiteralType

      static int getLiteralType(IFieldDescription fieldDescription)
      Extracts the type from a field description.
      Parameters:
      fieldDescription - the field description to parse
      Returns:
      the corresponding data type, or -1 if the description could not be parsed
    • getLiteralType

      static int getLiteralType(IFieldDescription fieldDescription, boolean hasDictionary)
      Extracts the type from a field description.
      Parameters:
      fieldDescription - the field description to parse
      hasDictionary - whether the given field takes part in a dictionary
      Returns:
      the corresponding data type, or -1 if the description could not be parsed