Class SchemaAttribute
- java.lang.Object
-
- org.odpi.openmetadata.frameworks.connectors.properties.beans.PropertyBase
-
- org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader
-
- org.odpi.openmetadata.frameworks.connectors.properties.beans.Referenceable
-
- org.odpi.openmetadata.frameworks.connectors.properties.beans.SchemaElement
-
- org.odpi.openmetadata.frameworks.connectors.properties.beans.SchemaAttribute
-
- All Implemented Interfaces:
Serializable
public class SchemaAttribute extends SchemaElement
SchemaAttribute describes a single attribute within a schema. The attribute has a name, order in the schema and cardinality. Its type is a SchemaType (such as StructSchemaType or PrimitiveSchemaType).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected List<String>aliasesprotected booleanallowsDuplicateValuesprotected List<SchemaAttributeRelationship>attributeRelationshipsprotected SchemaTypeattributeTypeprotected Stringcardinalityprotected StringdefaultValueOverrideprotected intelementPositionprotected booleanisNullableprotected intlengthprotected intmaxCardinalityprotected intminCardinalityprotected intminimumLengthprotected StringnativeJavaClassprotected booleanorderedValuesprotected intprecisionprotected DataItemSortOrdersortOrder-
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.SchemaElement
anchorGUID, description, displayName, expression, isCalculatedValue, isDeprecated
-
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.Referenceable
additionalProperties, confidenceGovernanceClassification, confidentialityGovernanceClassification, criticalityGovernanceClassification, latestChange, latestChangeDetails, meanings, qualifiedName, retentionGovernanceClassification, searchKeywords, securityTags
-
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader
classifications, extendedProperties, guid, type, url
-
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.PropertyBase
CURRENT_AUDIT_HEADER_VERSION
-
-
Constructor Summary
Constructors Constructor Description SchemaAttribute()Default constructorSchemaAttribute(SchemaAttribute template)Copy/clone constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description SchemaElementcloneSchemaElement()Return a clone of this schema element.booleanequals(Object objectToCompare)Compare the values of the supplied object with those stored in the current object.List<String>getAliases()Return a list of alternative names for the attribute.booleangetAllowsDuplicateValues()Return whether the same value can be used by more than one instance of this attribute.StringgetAttributeName()Deprecated.List<SchemaAttributeRelationship>getAttributeRelationships()Return any relationships to other schema attributes.SchemaTypegetAttributeType()Return the SchemaType that relates to the type of this attribute.StringgetCardinality()Return the display version of the cardinality defined for this schema attribute.SchemaAttributeCategorygetCategory()Return the category of the schema attribute.StringgetDefaultValueOverride()Return any default value for this attribute that would override the default defined in the schema element for this attribute's type (note only used is type is primitive).intgetElementPosition()Return the position of this schema attribute in its parent schema.booleangetIsNullable()Return whether the field is nullable or not.intgetLength()Return the length of the data field.intgetMaxCardinality()Return the maximum number of instances allowed for this attribute.intgetMinCardinality()Return this minimum number of instances allowed for this attribute.intgetMinimumLength()Return the minimum length of the data.StringgetNativeJavaClass()Return the name of the Java class to use to represent this type.booleangetOrderedValues()Return whether the attribute instances are arranged in an order.intgetPrecision()Return the number of significant digits to the right of decimal point.DataItemSortOrdergetSortOrder()Return the order that the attribute instances are arranged in - if any.inthashCode()Return a number that represents the contents of this object.voidsetAliases(List<String> aliases)Set up a list of alternative names for the attribute.voidsetAllowsDuplicateValues(boolean allowsDuplicateValues)Set up whether the same value can be used by more than one instance of this attribute.voidsetAttributeName(String attributeName)Deprecated.voidsetAttributeRelationships(List<SchemaAttributeRelationship> attributeRelationships)Set up any relationships to other schema attributes.voidsetAttributeType(SchemaType attributeType)Set up the SchemaType that relates to the type of this attribute.voidsetCardinality(String cardinality)Set up the display version of the cardinality defined for this schema attribute.voidsetCategory(SchemaAttributeCategory category)Set up the category of the schema attribute.voidsetDefaultValueOverride(String defaultValueOverride)Set up any default value for this attribute that would override the default defined in the schema element for this attribute's type (note only used is type is primitive).voidsetElementPosition(int elementPosition)Set up the position of this schema attribute in its parent schema.voidsetIsNullable(boolean nullable)Set up whether the field is nullable or not.voidsetLength(int length)Set up the length of the data field.voidsetMaxCardinality(int maxCardinality)Set up the maximum number of instances allowed for this attribute.voidsetMinCardinality(int minCardinality)Set up the minimum number of instances allowed for this attribute.voidsetMinimumLength(int minimumLength)Set up the minimum length of the data.voidsetNativeJavaClass(String nativeJavaClass)Set up the name of the Java class to use to represent this type.voidsetOrderedValues(boolean orderedValues)Set up whether the attribute instances are arranged in an order.voidsetPrecision(int precision)Set up the number of significant digits to the right of decimal point.voidsetSortOrder(DataItemSortOrder sortOrder)Set up the order that the attribute instances are arranged in - if any.StringtoString()Standard toString method.-
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.SchemaElement
getAnchorGUID, getDescription, getDisplayName, getExpression, getIsDeprecated, isCalculatedValue, setAnchorGUID, setCalculatedValue, setDescription, setDisplayName, setExpression, setIsDeprecated
-
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.Referenceable
getAdditionalProperties, getConfidenceGovernanceClassification, getConfidentialityGovernanceClassification, getCriticalityGovernanceClassification, getLatestChange, getLatestChangeDetails, getMeanings, getQualifiedName, getRetentionGovernanceClassification, getSearchKeywords, getSecurityTags, setAdditionalProperties, setConfidenceGovernanceClassification, setConfidentialityGovernanceClassification, setCriticalityGovernanceClassification, setLatestChange, setLatestChangeDetails, setMeanings, setQualifiedName, setRetentionGovernanceClassification, setSearchKeywords, setSecurityTags
-
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementHeader
getClassifications, getExtendedProperties, getGUID, getType, getURL, setClassifications, setExtendedProperties, setGUID, setType, setURL
-
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.PropertyBase
getHeaderVersion, setHeaderVersion
-
-
-
-
Field Detail
-
elementPosition
protected int elementPosition
-
cardinality
protected String cardinality
-
minCardinality
protected int minCardinality
-
maxCardinality
protected int maxCardinality
-
allowsDuplicateValues
protected boolean allowsDuplicateValues
-
orderedValues
protected boolean orderedValues
-
defaultValueOverride
protected String defaultValueOverride
-
sortOrder
protected DataItemSortOrder sortOrder
-
minimumLength
protected int minimumLength
-
length
protected int length
-
precision
protected int precision
-
isNullable
protected boolean isNullable
-
attributeType
protected SchemaType attributeType
-
attributeRelationships
protected List<SchemaAttributeRelationship> attributeRelationships
-
nativeJavaClass
protected String nativeJavaClass
-
-
Constructor Detail
-
SchemaAttribute
public SchemaAttribute()
Default constructor
-
SchemaAttribute
public SchemaAttribute(SchemaAttribute template)
Copy/clone constructor.- Parameters:
template- template schema attribute to copy.
-
-
Method Detail
-
cloneSchemaElement
public SchemaElement cloneSchemaElement()
Return a clone of this schema element. This method is needed because schema element is abstract.- Specified by:
cloneSchemaElementin classSchemaElement- Returns:
- Clone of subclass.
-
getAttributeName
@Deprecated public String getAttributeName()
Deprecated.Return the name of this schema attribute. This value is deprecated in favour of displayName.- Returns:
- String attribute name
-
setAttributeName
@Deprecated public void setAttributeName(String attributeName)
Deprecated.Set up the name of this schema attribute. This value is deprecated in favour of displayName.- Parameters:
attributeName- String attribute name
-
getElementPosition
public int getElementPosition()
Return the position of this schema attribute in its parent schema.- Returns:
- int position in schema - 0 means first
-
setElementPosition
public void setElementPosition(int elementPosition)
Set up the position of this schema attribute in its parent schema.- Parameters:
elementPosition- int position in schema - 0 means first
-
getCategory
public SchemaAttributeCategory getCategory()
Return the category of the schema attribute.- Returns:
- enum SchemaAttributeCategory
-
setCategory
public void setCategory(SchemaAttributeCategory category)
Set up the category of the schema attribute.- Parameters:
category- enum SchemaAttributeCategory
-
getCardinality
public String getCardinality()
Return the display version of the cardinality defined for this schema attribute. There is a deprecated value that many mean this value is set explicitly. Otherwise it is manufactured from the min and max values.- Returns:
- String cardinality defined for this schema attribute.
-
setCardinality
public void setCardinality(String cardinality)
Set up the display version of the cardinality defined for this schema attribute.- Parameters:
cardinality- String cardinality defined for this schema attribute.
-
getMinCardinality
public int getMinCardinality()
Return this minimum number of instances allowed for this attribute.- Returns:
- int
-
setMinCardinality
public void setMinCardinality(int minCardinality)
Set up the minimum number of instances allowed for this attribute.- Parameters:
minCardinality- int
-
getMaxCardinality
public int getMaxCardinality()
Return the maximum number of instances allowed for this attribute.- Returns:
- int (-1 means infinite)
-
setMaxCardinality
public void setMaxCardinality(int maxCardinality)
Set up the maximum number of instances allowed for this attribute.- Parameters:
maxCardinality- int (-1 means infinite)
-
getAllowsDuplicateValues
public boolean getAllowsDuplicateValues()
Return whether the same value can be used by more than one instance of this attribute.- Returns:
- boolean flag
-
setAllowsDuplicateValues
public void setAllowsDuplicateValues(boolean allowsDuplicateValues)
Set up whether the same value can be used by more than one instance of this attribute.- Parameters:
allowsDuplicateValues- boolean flag
-
getOrderedValues
public boolean getOrderedValues()
Return whether the attribute instances are arranged in an order.- Returns:
- boolean flag
-
setOrderedValues
public void setOrderedValues(boolean orderedValues)
Set up whether the attribute instances are arranged in an order.- Parameters:
orderedValues- boolean flag
-
getSortOrder
public DataItemSortOrder getSortOrder()
Return the order that the attribute instances are arranged in - if any.- Returns:
- DataItemSortOrder enum
-
setSortOrder
public void setSortOrder(DataItemSortOrder sortOrder)
Set up the order that the attribute instances are arranged in - if any.- Parameters:
sortOrder- DataItemSortOrder enum
-
getMinimumLength
public int getMinimumLength()
Return the minimum length of the data.- Returns:
- int
-
setMinimumLength
public void setMinimumLength(int minimumLength)
Set up the minimum length of the data.- Parameters:
minimumLength- int
-
getLength
public int getLength()
Return the length of the data field.- Returns:
- int
-
setLength
public void setLength(int length)
Set up the length of the data field.- Parameters:
length- int
-
getPrecision
public int getPrecision()
Return the number of significant digits to the right of decimal point.- Returns:
- int
-
setPrecision
public void setPrecision(int precision)
Set up the number of significant digits to the right of decimal point.- Parameters:
precision- int
-
getIsNullable
public boolean getIsNullable()
Return whether the field is nullable or not.- Returns:
- boolean
-
setIsNullable
public void setIsNullable(boolean nullable)
Set up whether the field is nullable or not.- Parameters:
nullable- boolean
-
getDefaultValueOverride
public String getDefaultValueOverride()
Return any default value for this attribute that would override the default defined in the schema element for this attribute's type (note only used is type is primitive).- Returns:
- String default value override
-
setDefaultValueOverride
public void setDefaultValueOverride(String defaultValueOverride)
Set up any default value for this attribute that would override the default defined in the schema element for this attribute's type (note only used is type is primitive).- Parameters:
defaultValueOverride- String default value override
-
getAttributeType
public SchemaType getAttributeType()
Return the SchemaType that relates to the type of this attribute.- Returns:
- SchemaType
-
setAttributeType
public void setAttributeType(SchemaType attributeType)
Set up the SchemaType that relates to the type of this attribute.- Parameters:
attributeType- SchemaType
-
getAttributeRelationships
public List<SchemaAttributeRelationship> getAttributeRelationships()
Return any relationships to other schema attributes.- Returns:
- list of attribute relationships
-
setAttributeRelationships
public void setAttributeRelationships(List<SchemaAttributeRelationship> attributeRelationships)
Set up any relationships to other schema attributes.- Parameters:
attributeRelationships- list of attribute relationships
-
getNativeJavaClass
public String getNativeJavaClass()
Return the name of the Java class to use to represent this type.- Returns:
- fully qualified Java class name
-
setNativeJavaClass
public void setNativeJavaClass(String nativeJavaClass)
Set up the name of the Java class to use to represent this type.- Parameters:
nativeJavaClass- fully qualified Java class name
-
getAliases
public List<String> getAliases()
Return a list of alternative names for the attribute.- Returns:
- list of names
-
setAliases
public void setAliases(List<String> aliases)
Set up a list of alternative names for the attribute.- Parameters:
aliases- list of names
-
toString
public String toString()
Standard toString method.- Overrides:
toStringin classSchemaElement- Returns:
- print out of variables in a JSON-style
-
equals
public boolean equals(Object objectToCompare)
Compare the values of the supplied object with those stored in the current object.- Overrides:
equalsin classSchemaElement- Parameters:
objectToCompare- supplied object- Returns:
- boolean result of comparison
-
hashCode
public int hashCode()
Return a number that represents the contents of this object.- Overrides:
hashCodein classSchemaElement- Returns:
- int
-
-