Class IndexFieldDef
java.lang.Object
com.northconcepts.datapipeline.foundations.core.Bean
com.northconcepts.datapipeline.foundations.core.FoundationObject
com.northconcepts.datapipeline.foundations.schema.SchemaObject
com.northconcepts.datapipeline.foundations.schema.SchemaPart
com.northconcepts.datapipeline.foundations.schema.IndexFieldDef
- All Implemented Interfaces:
DataExceptionContributor,JsonSerializable,RecordSerializable,XmlSerializable,SchemaProblemsSupplier,JavaCodeGenerator,Serializable,Cloneable
public class IndexFieldDef
extends SchemaPart
implements Cloneable, SchemaProblemsSupplier, JavaCodeGenerator
The metadata model for a field in an entity's index.
- See Also:
-
Field Summary
Fields inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
internalId, internalName, log, TIMESTAMP_FORMATFields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
ConstructorsConstructorDescriptionIndexFieldDef(String fieldName) Creates an ascending index field for the named entity field.IndexFieldDef(String fieldName, boolean ascending) -
Method Summary
Modifier and TypeMethodDescriptionThrows aDataExceptionif this object is invalid, otherwise returns it; the base implementation checks nothing.clone()booleanfromRecord(Record source) Loads this instance's state from a record and returnsthis(for fluid API call chaining).fromXmlElement(Element fieldDefElement) voidAppends Java source code representing this object to the given builder.Returns the name of the entity field this index field refers to.Returns the index containing this field or null if it has not been added to one.intReturns the zero-based index of this index field inIndexDef.Returns a qualified name that includes the name of this index field and theIndexDefabove it separated by period.Returns the fully qualified name that includes the name of this index field and all names in its hierarchy separated by period.The schema of the parent entity containing this field.getSchemaDef(boolean throwException) Returns the schema of the index's entity; if the index, entity or schema is missing, throws aDataExceptionwhenthrowExceptionis true and returns null otherwise.Returns the schema part containing this one or null if there is none.Returns the name identifying this part, such as an entity's name or an index field's field name.Returns the kind of part this is, such asSchemaPartType.ENTITY.voidgetSchemaProblems(List<SchemaProblem> problems, boolean includeChildren) Adds this element's problems to the list, plus those of its children whenincludeChildrenis true; the default adds none.inthashCode()booleanIndicates if this field is sorted in ascending order in the index (defaults to true).setAscending(boolean ascending) Indicates if this field is sorted in ascending order in the index (defaults to true).setFieldName(String fieldName) Sets the name of the entity field this index field refers to.protected IndexFieldDefsetIndexDef(IndexDef indexDef) Sets the parent index; called byIndexDefwhen this field is added to it.toJson()toRecord()Converts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.toXmlElement(Document document) Returns an element, created withdocument, describing this object; the default implementation throws aDataException.Methods inherited from class com.northconcepts.datapipeline.foundations.schema.SchemaPart
getSchemaName, getSchemaPartContainerName, getSchemaPartContainerTypeMethods inherited from class com.northconcepts.datapipeline.foundations.core.FoundationObject
addExceptionProperties, assertValid, exception, exception, exception, getInternalId, getInternalName, resetInternalIdMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.northconcepts.datapipeline.core.DataExceptionContributor
addExceptionPropertiesMethods inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
fromJson, fromJson, toJson, toJsonMethods inherited from interface com.northconcepts.datapipeline.foundations.schema.SchemaProblemsSupplier
getSchemaProblems, getSchemaProblems
-
Constructor Details
-
IndexFieldDef
public IndexFieldDef() -
IndexFieldDef
-
IndexFieldDef
Creates an ascending index field for the named entity field.
-
-
Method Details
-
getSchemaProblems
Description copied from interface:SchemaProblemsSupplierAdds this element's problems to the list, plus those of its children whenincludeChildrenis true; the default adds none.- Specified by:
getSchemaProblemsin interfaceSchemaProblemsSupplier
-
generateJavaCode
Description copied from interface:JavaCodeGeneratorAppends Java source code representing this object to the given builder.- Specified by:
generateJavaCodein interfaceJavaCodeGenerator
-
clone
- Overrides:
clonein classFoundationObject
-
assertValid
Description copied from class:FoundationObjectThrows aDataExceptionif this object is invalid, otherwise returns it; the base implementation checks nothing.- Overrides:
assertValidin classFoundationObject
-
getIndexDef
Returns the index containing this field or null if it has not been added to one. -
setIndexDef
Sets the parent index; called byIndexDefwhen this field is added to it. -
getFieldName
Returns the name of the entity field this index field refers to. -
setFieldName
Sets the name of the entity field this index field refers to. -
getQualifiedName
Returns the fully qualified name that includes the name of this index field and all names in its hierarchy separated by period. -
getIndexQualifiedName
Returns a qualified name that includes the name of this index field and theIndexDefabove it separated by period. -
getSchemaDef
Returns the schema of the index's entity; if the index, entity or schema is missing, throws aDataExceptionwhenthrowExceptionis true and returns null otherwise. -
getSchemaDef
The schema of the parent entity containing this field.- Specified by:
getSchemaDefin classSchemaPart
-
getSchemaPartContainer
Description copied from class:SchemaPartReturns the schema part containing this one or null if there is none.- Specified by:
getSchemaPartContainerin classSchemaPart
-
getSchemaPartType
Description copied from class:SchemaPartReturns the kind of part this is, such asSchemaPartType.ENTITY.- Specified by:
getSchemaPartTypein classSchemaPart
-
getSchemaPartName
Description copied from class:SchemaPartReturns the name identifying this part, such as an entity's name or an index field's field name.- Specified by:
getSchemaPartNamein classSchemaPart
-
isAscending
public boolean isAscending()Indicates if this field is sorted in ascending order in the index (defaults to true). -
setAscending
Indicates if this field is sorted in ascending order in the index (defaults to true). -
getIndexInIndexDef
public int getIndexInIndexDef()Returns the zero-based index of this index field inIndexDef. -
toJson
- Specified by:
toJsonin interfaceJsonSerializable- Specified by:
toJsonin interfaceRecordSerializable
-
toXmlElement
Description copied from interface:XmlSerializableReturns an element, created withdocument, describing this object; the default implementation throws aDataException.- Specified by:
toXmlElementin interfaceXmlSerializable
-
fromXmlElement
- Specified by:
fromXmlElementin interfaceXmlSerializable
-
toRecord
Description copied from interface:RecordSerializableConverts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.- Specified by:
toRecordin interfaceRecordSerializable- Overrides:
toRecordin classBean
-
fromRecord
Description copied from interface:RecordSerializableLoads this instance's state from a record and returnsthis(for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.- Specified by:
fromRecordin interfaceRecordSerializable- Overrides:
fromRecordin classBean- Parameters:
source-- Returns:
- this instance.
-
hashCode
public int hashCode() -
equals
-