Package mc.core.domain.generic
Class AttributeValue
java.lang.Object
mc.core.domain.generic.AttributeValue
- All Implemented Interfaces:
Serializable
this class is a data container for bracing data for an logical attribute assignment to an object (ComplexEntity). it
collects the EntityToAttribute objects for the assignment, where we have the following information:
- object (
ComplexEntity) - attribute (
Attribute) - list of (
EntityToAttributeentities, each with filter data like territory, valid date and prio for sort - list of data values from the EntityToAttribute entities
- alternative attribute name for displaying
- attribute description for displaying
- mandatory flag
- filter for enum attribute standard values
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionAttributeValue(ComplexEntity object, Attribute attribute) AttributeValue(Attribute attribute) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddEntityToAttribute(EntityToAttribute entityToAttribute) INTERNAL: add to internal e2a listcopyFor(ComplexEntity object) creates a copy of this AttributeValue with given object but without EntityToAttributesbooleandisplay as parent if assignment is a classification (MC-7669)attribute of AV.getAttributeDisplayDescription(Locale locale) getAttributeDisplayName(Locale locale) getDataValues(Locale locale) getDataValues(Territory territory, Locale locale) getDataValueSets(Territory territory) getDisplayString(Locale locale) getDisplayString(Locale locale, List<Territory> territories) getEntityToAttributeForDV(DataValue dataValue) getEntityToAttributeForDVSet(DataValueSet dataValueSet) getEntityToAttributes(Territory territory) object of AV.intgetPrio()get prio from additional EntityToAttributePrio (OA or CA), assignment (TA or CA), or EntityToAttribute<T extends DataValue>
TgetSingleDataValue(Class<T> dvClass, Locale locale) For single value: retrieve the single dataValue in given locale and subclass of actual dataValue.getSingleDataValue(Locale locale) For single value: retrieve the single dataValue in given locale.inthashCode()inheritanceDisabled(boolean inheritanceDisabled) INTERNALbooleanbooleanDeprecated.booleanisInheritedBy(ComplexEntity entity) in case of inherited AV (not overwritten) this checks the entity for which AVs have been built while getObject() returns parentbooleanbooleanbooleanprio(int prio) INTERNALvoidremoveEntityToAttribute(EntityToAttribute entityToAttribute) EXPERT: remove entityToAttribute from internal e2a listvoidINTERNALvoidsetAssignment(EntityToAttributePrio assignment) INTERNALvoidsetAssignment(IAttributeAssignment assignment) INTERNALvoidsetAssignment(IAttributeAssignment assignment, Set<String> filter) INTERNALvoidsetAttributeDisplayDescription(String attributeDisplayDescription) voidsetAttributeDisplayName(String attributeDisplayName) Force attribute given representation.setCurrentTerritory(Territory currentTerritory) voidsetEntityToAttributes(List<EntityToAttribute> entityToAttributes) EXPERT: reset internal e2a listsetInherited(ComplexEntity heir) voidsetMandatory(boolean mandatory) voidsetOverwritten(AttributeValue overwritten) INTERNALvoidsetReadonly(boolean readonly) toString()
-
Constructor Details
-
AttributeValue
-
AttributeValue
-
-
Method Details
-
copyFor
creates a copy of this AttributeValue with given object but without EntityToAttributes- Parameters:
object- optional- Returns:
- a new AttributeValue
-
getAttributeDisplayName
- Parameters:
locale- Locale to use for translating attribute and appended territory (if any).- Returns:
- Localized representation of
Attribute. Does not include attribute value.
-
getAttributeDisplayDescription
-
setAttributeDisplayName
Force attribute given representation.- Parameters:
attributeDisplayName- Text to use instead ofgetAttributeDisplayName(Locale)'s default implementation.
-
setAttributeDisplayDescription
- Parameters:
attributeDisplayDescription- Tooltip/Infobox for attribute.
-
getObject
object of AV. may be null -
getAttribute
attribute of AV. never null -
getCurrentTerritory
-
setCurrentTerritory
-
setEntityToAttributes
EXPERT: reset internal e2a list -
removeEntityToAttribute
EXPERT: remove entityToAttribute from internal e2a list -
addEntityToAttribute
INTERNAL: add to internal e2a list -
getEntityToAttributes
- Returns:
- all e2a (copy of internal list). no filtering through
setCurrentTerritory(Territory)
-
getEntityToAttributes
- Returns:
- INTERNAL e2a list reduced on a territory. all if territory is null
-
getEntityToAttributeForDV
- Returns:
- e2a for given dataValue if it is part of this AV. filtered through
setCurrentTerritory(Territory)
-
getEntityToAttributeForDVSet
- Returns:
- e2a for given dataValueSet if it is part of this AV. filtered through
setCurrentTerritory(Territory)
-
getDataValueSets
- Returns:
- all dataValueSets. filtered through
setCurrentTerritory(Territory)
-
getDataValueSets
- Returns:
- all dataValueSets for territory. all if territory is null
-
getDataValues
- Returns:
- all dataValues. filtered through
setCurrentTerritory(Territory)
-
getDataValues
- Returns:
- all dataValues for locale. filtered through
setCurrentTerritory(Territory)
-
getDataValues
- Returns:
- all dataValues for locale. all if territory is null
-
getSingleDataValue
For single value: retrieve the single dataValue in given locale. filtered throughsetCurrentTerritory(Territory)- Parameters:
locale- optional, mandatory for locale dependent dataTypes- Returns:
- dataValue if exists or null
- Throws:
IllegalStateException- if attribute has more than one dataValues in given locale (multivalue or current territory not set)
-
getSingleDataValue
For single value: retrieve the single dataValue in given locale and subclass of actual dataValue. filtered throughsetCurrentTerritory(Territory)- Parameters:
dvClass- mandatory, subclass of dataValue matching this AttributeValuelocale- optional, mandatory for locale dependent dataTypes- Returns:
- DataValue subclass if exists and is the same as given dvClass, otherwise null
- Throws:
IllegalStateException- if attribute has more than one dataValues in given locale (multivalue or current territory not set)
-
setReadonly
public void setReadonly(boolean readonly) -
isReadonly
public boolean isReadonly()- Returns:
- value of readonly flag if flag has been set.
-
isReadonlyByAssignment
public boolean isReadonlyByAssignment()- Returns:
- value of readonly flag of assignment if assignment is present.
-
isMandatory
public boolean isMandatory()- Returns:
- value of mandatory flag of assignment (if assignment is present) or mandatory flag set.
-
setMandatory
public void setMandatory(boolean mandatory) -
getFilter
- Returns:
- additional filter values of explicit filter or assignment if set. else null
-
isInherited
Deprecated.work not correct for object list with parent and children (MC-23341)
use isInheritedBy() instead- Returns:
- value of inherited flag.
-
setInherited
-
isInheritedBy
in case of inherited AV (not overwritten) this checks the entity for which AVs have been built while getObject() returns parent -
removeInheritance
INTERNAL -
getOverwritten
-
setOverwritten
INTERNAL -
isInheritanceDisabled
public boolean isInheritanceDisabled() -
inheritanceDisabled
INTERNAL -
getPrio
public int getPrio()get prio from additional EntityToAttributePrio (OA or CA), assignment (TA or CA), or EntityToAttribute -
prio
INTERNAL -
setAssignment
INTERNAL -
setAssignment
INTERNAL -
setAssignment
INTERNAL -
getAssignment
display as parent if assignment is a classification (MC-7669) -
getDisplayString
- Parameters:
locale- Locale in which to return the value.- Returns:
- Textual representation of attribute's value.
-
getDisplayString
- Parameters:
locale- Locale in which to return the value.territories- Territories for which to show values. Given an empty list, result in displaying values for all territories.- Returns:
- Textual representation of attribute's value.
-
getValidationInfo
-
toString
-
equals
-
hashCode
public int hashCode()
-
use isInheritedBy() instead