Class SchemaAttribute
java.lang.Object
org.odpi.openmetadata.frameworks.openmetadata.metadataelements.ElementControlHeader
org.odpi.openmetadata.frameworks.openmetadata.metadataelements.ElementHeader
org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementBase
org.odpi.openmetadata.frameworks.connectors.properties.beans.Referenceable
org.odpi.openmetadata.frameworks.connectors.properties.beans.GovernedReferenceable
org.odpi.openmetadata.frameworks.connectors.properties.beans.SchemaElement
org.odpi.openmetadata.frameworks.connectors.properties.beans.SchemaAttribute
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).
-
Field Summary
Modifier and TypeFieldDescriptionprotected boolean
protected List<SchemaAttributeRelationship>
protected SchemaType
protected String
protected String
protected int
protected boolean
protected int
protected int
protected int
protected int
protected String
protected boolean
protected int
protected int
protected DataItemSortOrder
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.SchemaElement
description, displayName, expression, expressionType, isCalculatedValue, isDeprecated
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.GovernedReferenceable
meanings, searchKeywords
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.Referenceable
additionalProperties, qualifiedName
Fields inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementBase
extendedProperties
Fields inherited from class org.odpi.openmetadata.frameworks.openmetadata.metadataelements.ElementControlHeader
CURRENT_AUDIT_HEADER_VERSION
-
Constructor Summary
ConstructorDescriptionDefault constructorSchemaAttribute
(SchemaAttribute template) Copy/clone constructor. -
Method Summary
Modifier and TypeMethodDescriptionReturn a clone of this schema element.boolean
Compare the values of the supplied object with those stored in the current object.Return a list of alternative names for the attribute.boolean
Return whether the same value can be used by more than one instance of this attribute.Deprecated.Return any relationships to other schema attributes.Return the SchemaType that relates to the type of this attribute.Return the display version of the cardinality defined for this schema attribute.Return the category of the schema attribute.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).int
Return the position of this schema attribute in its parent schema.boolean
Return whether the field is nullable or not.int
Return the length of the data field.int
Return the maximum number of instances allowed for this attribute.int
Return this minimum number of instances allowed for this attribute.int
Return the minimum length of the data.Return the name of the Java class to use to represent this type.boolean
Return whether the attribute instances are arranged in an order.int
Return the number of significant digits to the right of decimal point.int
Return the number of significant digits before the decimal point (zero means it is an integer).Return the order that the attribute instances are arranged in - if any.int
hashCode()
Return a number that represents the contents of this object.void
setAliases
(List<String> aliases) Set up a list of alternative names for the attribute.void
setAllowsDuplicateValues
(boolean allowsDuplicateValues) Set up whether the same value can be used by more than one instance of this attribute.void
setAttributeName
(String attributeName) Deprecated.void
setAttributeRelationships
(List<SchemaAttributeRelationship> attributeRelationships) Set up any relationships to other schema attributes.void
setAttributeType
(SchemaType attributeType) Set up the SchemaType that relates to the type of this attribute.void
setCardinality
(String cardinality) Set up the display version of the cardinality defined for this schema attribute.void
setCategory
(SchemaAttributeCategory category) Set up the category of the schema attribute.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).void
setElementPosition
(int elementPosition) Set up the position of this schema attribute in its parent schema.void
setIsNullable
(boolean nullable) Set up whether the field is nullable or not.void
setLength
(int length) Set up the length of the data field.void
setMaxCardinality
(int maxCardinality) Set up the maximum number of instances allowed for this attribute.void
setMinCardinality
(int minCardinality) Set up the minimum number of instances allowed for this attribute.void
setMinimumLength
(int minimumLength) Set up the minimum length of the data.void
setNativeJavaClass
(String nativeJavaClass) Set up the name of the Java class to use to represent this type.void
setOrderedValues
(boolean orderedValues) Set up whether the attribute instances are arranged in an order.void
setPrecision
(int precision) Set up the number of significant digits to the right of decimal point.void
setSignificantDigits
(int significantDigits) Set up the number of significant digits before the decimal point (zero means it is an integer).void
setSortOrder
(DataItemSortOrder sortOrder) Set up the order that the attribute instances are arranged in - if any.toString()
Standard toString method.Methods inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.SchemaElement
getDescription, getDisplayName, getExpression, getExpressionType, getIsCalculatedValue, getIsDeprecated, setDescription, setDisplayName, setExpression, setExpressionType, setIsCalculatedValue, setIsDeprecated
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.GovernedReferenceable
getMeanings, getSearchKeywords, setMeanings, setSearchKeywords
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.Referenceable
getAdditionalProperties, getQualifiedName, setAdditionalProperties, setQualifiedName
Methods inherited from class org.odpi.openmetadata.frameworks.connectors.properties.beans.ElementBase
getExtendedProperties, setExtendedProperties
Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.metadataelements.ElementHeader
getClassifications, getGUID, setClassifications, setGUID
Methods inherited from class org.odpi.openmetadata.frameworks.openmetadata.metadataelements.ElementControlHeader
getHeaderVersion, getOrigin, getStatus, getType, getVersions, setHeaderVersion, setOrigin, setStatus, setType, setVersions
-
Field Details
-
elementPosition
protected int elementPosition -
cardinality
-
minCardinality
protected int minCardinality -
maxCardinality
protected int maxCardinality -
allowsDuplicateValues
protected boolean allowsDuplicateValues -
orderedValues
protected boolean orderedValues -
defaultValueOverride
-
sortOrder
-
minimumLength
protected int minimumLength -
length
protected int length -
precision
protected int precision -
significantDigits
protected int significantDigits -
isNullable
protected boolean isNullable -
attributeType
-
attributeRelationships
-
nativeJavaClass
-
aliases
-
-
Constructor Details
-
SchemaAttribute
public SchemaAttribute()Default constructor -
SchemaAttribute
Copy/clone constructor.- Parameters:
template
- template schema attribute to copy.
-
-
Method Details
-
cloneSchemaElement
Return a clone of this schema element. This method is needed because schema element is abstract.- Specified by:
cloneSchemaElement
in classSchemaElement
- Returns:
- Clone of subclass.
-
getAttributeName
Deprecated.Return the name of this schema attribute. This value is deprecated in favour of displayName.- Returns:
- String attribute name
-
setAttributeName
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
Return the category of the schema attribute.- Returns:
- enum SchemaAttributeCategory
-
setCategory
Set up the category of the schema attribute.- Parameters:
category
- enum SchemaAttributeCategory
-
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
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
Return the order that the attribute instances are arranged in - if any.- Returns:
- DataItemSortOrder enum
-
setSortOrder
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
-
getSignificantDigits
public int getSignificantDigits()Return the number of significant digits before the decimal point (zero means it is an integer).- Returns:
- int
-
setSignificantDigits
public void setSignificantDigits(int significantDigits) Set up the number of significant digits before the decimal point (zero means it is an integer).- Parameters:
significantDigits
- 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
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
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
Return the SchemaType that relates to the type of this attribute.- Returns:
- SchemaType
-
setAttributeType
Set up the SchemaType that relates to the type of this attribute.- Parameters:
attributeType
- SchemaType
-
getAttributeRelationships
Return any relationships to other schema attributes.- Returns:
- list of attribute relationships
-
setAttributeRelationships
Set up any relationships to other schema attributes.- Parameters:
attributeRelationships
- list of attribute relationships
-
getNativeJavaClass
Return the name of the Java class to use to represent this type.- Returns:
- fully qualified Java class name
-
setNativeJavaClass
Set up the name of the Java class to use to represent this type.- Parameters:
nativeJavaClass
- fully qualified Java class name
-
getAliases
Return a list of alternative names for the attribute.- Returns:
- list of names
-
setAliases
Set up a list of alternative names for the attribute.- Parameters:
aliases
- list of names
-
toString
Standard toString method.- Overrides:
toString
in classSchemaElement
- Returns:
- print out of variables in a JSON-style
-
equals
Compare the values of the supplied object with those stored in the current object.- Overrides:
equals
in 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:
hashCode
in classSchemaElement
- Returns:
- int
-