Class KeyValue
- All Implemented Interfaces:
GetContext,GetIdentifier,GetSequence,EntityData,PersistentData,Serializable
Data object for entity type KeyValue
KeyValue data are used for example for technical attributes of a product like weight, or size etc.
- Since:
- 4.0.0, 4.0.5 origin attribute supported, parentKeyValue and refKeyValue are to be referenced and not included, added JPA annotations, getLanguage() and getCountry() are deprecated
- See Also:
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsConstructorDescriptionKeyValue()Default constructor.KeyValue(String identifier, String key, String value, String dataType, String entityKeyValueId, Context context, Bucket bucket) Creates a KeyValueKeyValue(String identifier, String key, String keyLabel, String value, String dataType, String entityKeyValueId, Context context, String bucketId, String createdBy, Date createdOn, String updatedBy, Date updatedOn) -
Method Summary
Modifier and TypeMethodDescriptionGet the context for this element ornullif not set.getCord()Identifier of an entity in the entity model where the current object refers to.String key for grouping key values of the same type.Get the string identifier of the keyvalue.getKey()final StringgetPrice()final StringintGet sequence number for the keyvalue as given in the content system.getText()Get timestamp from the content system.getValue()Version string from the content systemvoidSets bucket and bucketId.voidsetBucketId(String bucketId) Sets bucketId and eventually removes current bucket if it does not match the idvoidsetBucketMetaData(Bucket bucketMetaData) voidsetConnectorEntity(ConnectorEntity connectorEntity) voidsetContentMetaData(List<ContentMetaData> contentMetaData) voidsetContext(Context context) set the context of entity data objectvoidvoidsetCreatedBy(String createdBy) voidsetCreatedOn(Date createdOn) voidsetDataType(String dataType) voidsetEntity(EntityKeyValue entityKeyValue) Sets entityKeyValue and entityKeyValueId.voidsetEntityIdentifier(String entityIdentifier) Identifier of an entity in the entity model where the current object refers to.voidsetEntityKeyValueId(String entityKeyValueId) Sets entityKeyValueId and eventually removes current entityKeyValue if it does not match the idvoidsetGroupIdentifier(String groupIdentifier) voidsetIdentifier(String identifier) voidvoidsetKeyLabel(String keyLabel) voidsetKeySymbol(String keySymbol) voidsetMediaAsset(MediaAsset mediaAsset) voidsetMediaObject(MediaObject mediaObject) voidsetMetaData(List<KeyValue> metaData) voidsetMetaDataParent(KeyValue metaDataParent) voidvoidsetParentKeyValue(KeyValue parentKeyValue) final voidsetParentKeyValueId(String parentKeyValueId) Sets parentKeyValueId and eventually removes current parentKeyValue if it does not match the idvoidvoidsetRefKeyValue(KeyValue refKeyValue) final voidsetRefKeyValueId(String refKeyValueId) Sets refKeyValueId and eventually removes current refKeyValue if it does not match the idvoidsetSequence(int sequence) voidvoidsetSubKeyValues(List<KeyValue> subKeyValues) voidsetTableCell(TableDataCell tableCell) voidsetTableData(TableData tableData) voidsetTableRow(TableDataRow tableRow) voidsetTemplate(String template) voidvoidsetTimestamp(String timestamp) voidsetUpdatedBy(String updatedBy) voidsetUpdatedOn(Date updatedOn) voidvoidsetVersion(String version) toString()
-
Constructor Details
-
KeyValue
public KeyValue()Default constructor. -
KeyValue
public KeyValue(String identifier, String key, String value, String dataType, String entityKeyValueId, Context context, Bucket bucket) Creates a KeyValue- Parameters:
identifier-getIdentifier()key-getKey()value-getValue()dataType-getDataType()entityKeyValueId-getEntityKeyValueId()context-getContext()bucket-getBucket()
-
KeyValue
public KeyValue(String identifier, String key, String keyLabel, String value, String dataType, String entityKeyValueId, Context context, String bucketId, String createdBy, Date createdOn, String updatedBy, Date updatedOn) - Parameters:
identifier-getIdentifier()key-getKey()keyLabel-getKeyLabel()value-getValue()dataType-getDataType()entityKeyValueId-getEntityKeyValueId()context-getContext()bucketId-getBucketId()createdBy-getCreatedBy()createdOn-getCreatedOn()updatedBy-getUpdatedBy()updatedOn-getUpdatedOn()
-
-
Method Details
-
getIdentifier
Get the string identifier of the keyvalue.- Specified by:
getIdentifierin interfaceEntityData- Specified by:
getIdentifierin interfaceGetIdentifier- Specified by:
getIdentifierin interfacePersistentData- Returns:
- identifier string or
nullif not set
-
setIdentifier
- Specified by:
setIdentifierin interfaceEntityData- Parameters:
identifier- seegetIdentifier()
-
getGroupIdentifier
String key for grouping key values of the same type.- Returns:
- group identifier string or
nullif not set
-
setGroupIdentifier
- Parameters:
groupIdentifier- seegetGroupIdentifier()
-
getVersion
Version string from the content system- Returns:
- version string or
nullif not set
-
setVersion
- Parameters:
version- seegetVersion()
-
getTimestamp
Get timestamp from the content system.Timestamp is used as a string to support differing types of timestamp representation as used by different content system. publishing server does not validate any format of this string.
- Returns:
- timestamp string
-
setTimestamp
- Parameters:
timestamp- seegetTimestamp()
-
getTemplate
- Returns:
- String identifier of the template to render this content.
-
setTemplate
- Parameters:
template-getTemplate()
-
getConnectorEntity
- Returns:
- connector entity object or
nullif not set
-
setConnectorEntity
- Parameters:
connectorEntity- seegetConnectorEntity()
-
getKey
- Returns:
- Name of the key, e.g. "length"
-
setKey
- Parameters:
key-getKey()
-
getKeyLabel
- Returns:
- Label for the key. Used for publishing, if key itself is something like a code.
-
setKeyLabel
- Parameters:
keyLabel-getKeyLabel()
-
getValue
- Returns:
- Value of the key-value object, e.g. "12.3" for a key named "length".
Value is always a string. You may use dataType property for specifying the preferred type.
-
setValue
- Parameters:
value-getValue()
-
getDataType
- Returns:
- Data type of the value (String, int, float, boolean).
There is no vocabulary explicitly restricting the values of this property.
-
setDataType
- Parameters:
dataType-getDataType()
-
getSource
- Returns:
- origin of the KeyValue, i.e. whether it comes from the connector or entity manager.
This property is set from the publishing server.
-
setSource
- Parameters:
source-getSource()
-
getSequence
public int getSequence()Get sequence number for the keyvalue as given in the content system.This should reflect the position of the current keyvalue in the sorting of keyvalues of its bucket.
- Specified by:
getSequencein interfaceGetSequence- Returns:
- ordered position within a list sequenceable objects
-
setSequence
public void setSequence(int sequence) - Parameters:
sequence- seegetSequence()
-
getRefKeyValue
- Returns:
- link to a referenced keyValue (like "Kilogramm")
-
setRefKeyValue
- Parameters:
refKeyValue-getRefKeyValue()
-
getParentKeyValue
- Returns:
- link to parent KeyValue
-
setParentKeyValue
- Parameters:
parentKeyValue-getParentKeyValue()
-
getEntity
- Returns:
- Entity from Entity Model
-
setEntity
Sets entityKeyValue and entityKeyValueId.- Parameters:
entityKeyValue-getEntity()- See Also:
-
getContext
Get the context for this element ornullif not set.- Specified by:
getContextin interfaceEntityData- Specified by:
getContextin interfaceGetContext- Returns:
- context
-
setContext
Description copied from interface:EntityDataset the context of entity data object- Specified by:
setContextin interfaceEntityData- Parameters:
context-getContext()
-
getBucket
- Returns:
- Parent bucket that this keyValue is related to.
-
setBucket
Sets bucket and bucketId.- Parameters:
bucket-getBucket()- See Also:
-
getMetaData
- Returns:
- List of meta data related to the bucket or empty list.
List is LAZY loaded.
-
setMetaData
- Parameters:
metaData- seegetMetaData()
-
getSubKeyValues
- Returns:
- List of KeyValues related to KeyValue.
List is LAZY loaded.
-
setSubKeyValues
- Parameters:
subKeyValues-getSubKeyValues()
-
getEntityKeyValueId
- Returns:
- Identifier of related entity in entity model.
-
setEntityKeyValueId
Sets entityKeyValueId and eventually removes current entityKeyValue if it does not match the id- Parameters:
entityKeyValueId-getEntityKeyValueId()
-
getBucketId
- Returns:
- Identifier of parent bucket that this content element is related to. Is null for following methods:
EntityManagerRemote.getEntityKeyValuesOfBucket(String, String, String, String, String, Context, String)EntityManagerRemote.getEntityKeyValuesByIdentifier(String, String, String, String, Context, String)EntityManagerRemote.getEntityKeyValuesOfPlanning(String, String, String, String, String, Context, String, String)}EntityManagerRemote.getEntityKeyValuesOfPlannedBucket(String, String, String, String, Context, String)}
-
setBucketId
Sets bucketId and eventually removes current bucket if it does not match the id- Parameters:
bucketId-getBucketId()
-
getKeySymbol
- Returns:
- Symbol for key
-
setKeySymbol
- Parameters:
keySymbol-getKeySymbol()
-
getCreatedBy
- Returns:
- creation user or
nullif not set
-
setCreatedBy
- Parameters:
createdBy- seegetCreatedBy()
-
getCreatedOn
- Returns:
- creation date or
nullif not set
-
setCreatedOn
- Parameters:
createdOn- seegetCreatedOn()
-
getUpdatedBy
- Returns:
- last modified user or
nullif not set
-
setUpdatedBy
- Parameters:
updatedBy- seegetUpdatedBy()
-
getUpdatedOn
- Returns:
- last modified date or
nullif not set
-
setUpdatedOn
- Parameters:
updatedOn- seegetUpdatedOn()
-
getText
-
setText
-
getTableData
-
setTableData
-
getMediaObject
-
setMediaObject
-
getPrice
-
setPrice
-
getMediaAsset
-
setMediaAsset
-
getMetaDataParent
-
setMetaDataParent
-
getCord
-
setCord
-
getTableRow
-
setTableRow
-
getBucketMetaData
-
setBucketMetaData
-
getTableCell
-
setTableCell
-
toString
-
getRefKeyValueId
- Returns:
- Identifier of related keyValue, e.g. a unit. Is null for following methods:
EntityManagerRemote.getEntityKeyValuesOfBucket(String, String, String, String, String, Context, String)EntityManagerRemote.getEntityKeyValuesByIdentifier(String, String, String, String, Context, String)EntityManagerRemote.getEntityKeyValuesOfPlanning(String, String, String, String, String, Context, String, String)}EntityManagerRemote.getEntityKeyValuesOfPlannedBucket(String, String, String, String, Context, String)}
-
setRefKeyValueId
Sets refKeyValueId and eventually removes current refKeyValue if it does not match the id- Parameters:
refKeyValueId-getRefKeyValueId()
-
getParentKeyValueId
- Returns:
- Identifier of parent keyValue. Is null for following methods:
EntityManagerRemote.getEntityKeyValuesOfBucket(String, String, String, String, String, Context, String)EntityManagerRemote.getEntityKeyValuesByIdentifier(String, String, String, String, Context, String)EntityManagerRemote.getEntityKeyValuesOfPlanning(String, String, String, String, String, Context, String, String)}EntityManagerRemote.getEntityKeyValuesOfPlannedBucket(String, String, String, String, Context, String)}
-
setParentKeyValueId
Sets parentKeyValueId and eventually removes current parentKeyValue if it does not match the id- Parameters:
parentKeyValueId-getParentKeyValueId()
-
getOrigin
- Returns:
- Origin of data entity object, e.g. name of the source system. This property is filled by the connector. Might return
null.
-
setOrigin
- Parameters:
origin-getOrigin()
-
getEntityIdentifier
Description copied from interface:EntityDataIdentifier of an entity in the entity model where the current object refers to.- Specified by:
getEntityIdentifierin interfaceEntityData- Returns:
- entity identifier as string
-
setEntityIdentifier
Description copied from interface:EntityDataIdentifier of an entity in the entity model where the current object refers to.- Specified by:
setEntityIdentifierin interfaceEntityData
-
getContentMetaData
- Returns:
- List of ContentMetaData related to KeyValue.
List is not loaded by Entity Manager in its standard methods. Use specific Entity Manager methods for loading.
-
setContentMetaData
- Parameters:
contentMetaData-getContentMetaData()
-