Class AttributeMetaData.MetaDataElement
- java.lang.Object
-
- de.aristaflow.adept2.core.orgmodelmanager.AttributeMetaData.MetaDataElement
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
OmeAttributeMetaData.OmeMetaDataElement
- Enclosing class:
- AttributeMetaData
public static class AttributeMetaData.MetaDataElement extends Object implements Serializable
Used to hold information about a single attribute.equals(Object)andhashCode()are implemented to only considergetEntityType()andgetName().- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MetaDataElement(EntityType entityType, String name, DataType dataType, int sizeHint, boolean readOnly, Map<String,String> attrMappings, Collection<String> writeBackExts)Creates a newMetaDataElementfor the designated attributes.MetaDataElement(EntityType entityType, String name, DataType dataType, int sizeHint, String omExt, String mappedTo, boolean imported, boolean isReadOnly)Deprecated, for removal: This API element is subject to removal in a future version.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description booleanequals(Object obj)StringgetAttrMapping(String omExt)Gets the attribute of the designated org model extension this attribute is mapped to ornullif the attribute is not mapped to the designated org model extension.Map<String,String>getAttrMappings()Gets the org model extensions (and the corresponding attributes) this attribute is mapped to.DataTypegetDataType()Returns the date type of the attribute.EntityTypegetEntityType()Returns the entity type this attribute belongs to.SerialisablePair<String,String>getMappedTo()Deprecated, for removal: This API element is subject to removal in a future version.UsegetAttrMapping(String)instead.StringgetName()Returns the the name of the attribute.intgetSizeHint()Returns the desired size (only for STRING attributes).inthashCode()booleanisImported()Deprecated, for removal: This API element is subject to removal in a future version.UsegetAttrMapping(String)instead.booleanisMandatory()Returns whether the attribute is mandatory within the entity type.booleanisReadOnly()Gets whether the attribute is read-only within the entity type.booleanwriteBackTo(String omExt)Gets whether the attribute should write back changes of this attribute caused byOmeAttributes.ATTR_VALUE_SYSTEM_SOURCE.
-
-
-
Constructor Detail
-
MetaDataElement
public MetaDataElement(EntityType entityType, String name, DataType dataType, int sizeHint, boolean readOnly, Map<String,String> attrMappings, Collection<String> writeBackExts)
Creates a newMetaDataElementfor the designated attributes.- Parameters:
entityType- The entity type the attribute belongs to.name- The name of the attribute.dataType- The data type of the attribute.sizeHint- The desired size of the attribute (only relevant for aStringattribute).readOnly- Whether the attribute is read-only within the entity type. This prevents changing the attribute at all and not only for a specific org model extension.attrMappings- The names of the attributes (values) in the corresponding org model extensions (keys) to which this OM attribute is mapped in priority order, higher priority first. This may benull.writeBackExts- The names of the org model extension (of the designatedattrMappingswhich want to be informed about changes fromOmeAttributes.ATTR_VALUE_SYSTEM_SOURCE. Only the values corresponding to the keys ofattrMappingswill be considered. This may benull.
-
MetaDataElement
@Deprecated(since="13.0.0", forRemoval=true) public MetaDataElement(EntityType entityType, String name, DataType dataType, int sizeHint, String omExt, String mappedTo, boolean imported, boolean isReadOnly)
Deprecated, for removal: This API element is subject to removal in a future version.Constructs a newMetaDataElementfor the given entity type, attribute name and data type.- Parameters:
entityType- the entity type this attribute belongs toname- the name of the attributedataType- the data type of the attributesizeHint- the desired size (only for STRING attributes)omExt- The name of the org model extension if this OM attribute is mapped to an atrtibute of an org model extension,nullotherwise.mappedTo- The name of the attribute of an org model extension if this OM attribute is mapped to one,nullotherwise.imported-isReadOnly- whether
-
-
Method Detail
-
getEntityType
public EntityType getEntityType()
Returns the entity type this attribute belongs to.- Returns:
- the entity type this attribute belongs to
-
getName
public String getName()
Returns the the name of the attribute.- Returns:
- the name of the attribute
-
getDataType
public DataType getDataType()
Returns the date type of the attribute.- Returns:
- the date type of the attribute
-
getSizeHint
public int getSizeHint()
Returns the desired size (only for STRING attributes).- Returns:
- the desired size
-
getMappedTo
@Deprecated(since="13.0.0", forRemoval=true) public SerialisablePair<String,String> getMappedTo()
Deprecated, for removal: This API element is subject to removal in a future version.UsegetAttrMapping(String)instead.Gets the name of the org model extension and the name of the attribute to which this attribute is mapped to. If this attribute is not mapped to an org model extension,nullwill be returned.- Returns:
- The name of the org model extension and the name of the attribute
to which this attribute is mapped to. If this attribute is not
mapped to an org model extension,
nullwill be returned.
-
getAttrMappings
public Map<String,String> getAttrMappings()
Gets the org model extensions (and the corresponding attributes) this attribute is mapped to. The org model extensions are ordered by their priority, with higher priority first.- Returns:
- The org model extensions (and the corresponding attributes) this attribute is mapped to in the order of their priority, higher priority first.
-
getAttrMapping
public String getAttrMapping(String omExt)
Gets the attribute of the designated org model extension this attribute is mapped to ornullif the attribute is not mapped to the designated org model extension.- Parameters:
omExt- The org model extension for which to get the attribute mapping of this attribute.- Returns:
- The attribute of the designated org model extension this attribute is mapped to.
nullfor an attribute that does not stem from the designated org model extension.
-
writeBackTo
public boolean writeBackTo(String omExt)
Gets whether the attribute should write back changes of this attribute caused byOmeAttributes.ATTR_VALUE_SYSTEM_SOURCE.- Parameters:
omExt- The org model extension for which to get whether a new attribute value of the system should be is written back to the org model extension.- Returns:
- Whether value changes of this attribute by the system should be written back to the designated org model extension.
-
isImported
@Deprecated(since="13.0.0", forRemoval=true) public boolean isImported()
Deprecated, for removal: This API element is subject to removal in a future version.UsegetAttrMapping(String)instead.Returns whether the value of a mapped attribute is imported into the OM.- Returns:
- whether the value of a mapped attribute is imported into the OM
-
isMandatory
public boolean isMandatory()
Returns whether the attribute is mandatory within the entity type.- Returns:
- whether the attribute is mandatory within the entity type
-
isReadOnly
public boolean isReadOnly()
Gets whether the attribute is read-only within the entity type.- Returns:
- Whether the attribute is read-only within the entity type (and thus implicitly for all org model extensions).
-
-