Interface IFieldDescription
- All Known Subinterfaces:
IVectorFieldDescription
- All Known Implementing Classes:
FieldDescription,VectorFieldDescription
- Author:
- ActiveViam
-
Method Summary
Modifier and TypeMethodDescriptionbooleanIndicates whether this field supports empty String as value.Gets the settings configuring the allocation strategy for storing this field.Class<?>Gets the class this field represents.Indicates the data type of the field.Gets the default value for this field.static intgetLiteralType(IFieldDescription fieldDescription) Extracts the type from a field description.static intgetLiteralType(IFieldDescription fieldDescription, boolean hasDictionary) Extracts the type from a field description.getName()Indicates the name of the field.booleanIndicates whether the field will be dictionarized.booleanIndicates whether this field supportsnullvalues.default booleanIndicates whether this field supports empty String as value.
-
Method Details
-
getName
String getName()Indicates the name of the field. Ifnullor empty aConfigurationExceptionwill be thrown when attempting to build anIDatastoreusing this field.- Returns:
- the name of the field
-
getDataType
String getDataType()Indicates the data type of the field. Can be one ofLiteralTypeoptionally followed by brackets ([]) for array types.- Returns:
- the type of the field
-
isNullable
boolean isNullable()Indicates whether this field supportsnullvalues. If set tofalse,nullvalues will be replaced bygetDefault(). SeegetDefault().Some
ISelectionListenerlike ActivePivot can add the constraint that some fields are non-nullable because the listener does not handlenullvalues on some fields of the records they receive.- Returns:
trueif the field can have anullvalue,falseotherwise
-
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:
trueif the field supports empty String,falseotherwise
-
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:
trueif the field supports empty String,falseotherwise
-
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
IDictionaryfor each of the initial values of this value.This can reduce the memory usage in most of the cases.
- Returns:
trueif dictionarized,falseotherwise
-
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
nullfor this field.In queries and continuous selections, the records sent to the
IPartitionedResultAcceptororISelectionListenercan containnullfields 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
nulland theisNullable()isfalse, a default value is imposed, depending ongetDataType(), see global constants. IfgetDataType()indicates an array type, no default value will be imposed and ifisNullable()isfalse, aConfigurationExceptionwill be thrown when anIDatastoreis built with this description.The type of the returned
Objectmust be consistent withgetDataType(), otherwise aConfigurationExceptionwill be thrown when anIDatastoreis 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
Extracts the type from a field description.- Parameters:
fieldDescription- the field description to parse- Returns:
- the corresponding data type, or
-1if the description could not be parsed
-
getLiteralType
Extracts the type from a field description.- Parameters:
fieldDescription- the field description to parsehasDictionary- whether the given field takes part in a dictionary- Returns:
- the corresponding data type, or
-1if the description could not be parsed
-