Class CsticModelImpl
- java.lang.Object
-
- de.hybris.platform.sap.productconfig.runtime.interf.model.impl.BaseModelImpl
-
- de.hybris.platform.sap.productconfig.runtime.interf.model.impl.CsticModelImpl
-
- All Implemented Interfaces:
BaseModel
,CsticModel
,java.lang.Cloneable
public class CsticModelImpl extends BaseModelImpl implements CsticModel
Default implementation of theCsticModel
-
-
Field Summary
-
Fields inherited from interface de.hybris.platform.sap.productconfig.runtime.interf.model.CsticModel
AUTHOR_DEFAULT, AUTHOR_NOAUTHOR, AUTHOR_SYSTEM, AUTHOR_USER, TYPE_BOOLEAN, TYPE_CLASS, TYPE_CURRENCY, TYPE_DATE, TYPE_FLOAT, TYPE_INTEGER, TYPE_STRING, TYPE_TIME, TYPE_UNDEFINED
-
-
Constructor Summary
Constructors Constructor Description CsticModelImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addValue(java.lang.String valueName)
Assigns the given value to the characteristic, while keeping any previous value assignments.
This is a typical operation for multi valued characteristics.void
clearValues()
clears all assigned Values, same as setting an empty List as assigned value listboolean
equals(java.lang.Object obj)
java.util.List<CsticValueModel>
getAssignableValues()
java.util.List<CsticValueModel>
getAssignedValues()
java.lang.String
getAuthor()
java.lang.String
getEntryFieldMask()
java.lang.String
getInstanceId()
java.lang.String
getInstanceName()
java.lang.String
getLanguageDependentName()
java.lang.String
getLongText()
Get the long text description for a cstic, which will be displayed under the cstic name in the UIjava.util.Set<ProductConfigMessage>
getMessages()
java.lang.String
getName()
int
getNumberScale()
java.lang.String
getPlaceholder()
java.lang.String
getSingleValue()
Gets the first value of the assigned Values if existing, or null otherwise.int
getStaticDomainLength()
int
getTypeLength()
protected CsticValueModel
getValueModelForValue(java.lang.String valueName)
int
getValueType()
int
hashCode()
boolean
isAllowsAdditionalValues()
boolean
isChangedByFrontend()
boolean
isComplete()
boolean
isConsistent()
boolean
isConstrained()
boolean
isIntervalInDomain()
boolean
isMultivalued()
boolean
isReadonly()
boolean
isRequired()
boolean
isRetractTriggered()
protected boolean
isValueNameMatching(java.lang.String value, CsticValueModel valueModel)
boolean
isVisible()
boolean
removeAssignableValue(java.lang.String valueName)
void
removeValue(java.lang.String valueName)
Remove the given value from the assigned values, while keeping the other value assignments.
This is a typical operation for multi valued characteristics.void
setAllowsAdditionalValues(boolean allowsAdditionalValues)
void
setAssignableValues(java.util.List<CsticValueModel> assignableValues)
void
setAssignedValues(java.util.List<CsticValueModel> assignedValues)
void
setAssignedValuesWithoutCheckForChange(java.util.List<CsticValueModel> assignedValues)
sets assigned value without to check whether the characteristic was changedvoid
setAuthor(java.lang.String author)
void
setChangedByFrontend(boolean changedByFrontend)
void
setComplete(boolean complete)
void
setConsistent(boolean consistent)
void
setConstrained(boolean constrained)
void
setEntryFieldMask(java.lang.String entryFieldMask)
void
setInstanceId(java.lang.String instanceId)
void
setInstanceName(java.lang.String instanceName)
Sets name of hosting instance.void
setIntervalInDomain(boolean intervalInDomain)
void
setLanguageDependentName(java.lang.String languageDependentName)
void
setLongText(java.lang.String longText)
Set the long text, which will be displayed under the Cstic name in the UIvoid
setMessages(java.util.Set<ProductConfigMessage> messages)
void
setMultivalued(boolean multivalued)
void
setName(java.lang.String name)
void
setNumberScale(int numberScale)
void
setPlaceholder(java.lang.String placeHolder)
void
setReadonly(boolean readonly)
void
setRequired(boolean required)
void
setRetractTriggered(boolean b)
void
setSingleValue(java.lang.String value)
Assigns the given value to the characteristic, overwriting any previous value assignments.
This is a typical operation for single valued characteristics.void
setStaticDomainLength(int staticDomainLength)
void
setTypeLength(int typeLength)
void
setValueType(int valueType)
void
setVisible(boolean visible)
java.lang.String
toString()
-
-
-
Method Detail
-
getName
public java.lang.String getName()
- Specified by:
getName
in interfaceCsticModel
- Returns:
- the characteristic name
-
setName
public void setName(java.lang.String name)
- Specified by:
setName
in interfaceCsticModel
- Parameters:
name
- characteristic name
-
getLanguageDependentName
public java.lang.String getLanguageDependentName()
- Specified by:
getLanguageDependentName
in interfaceCsticModel
- Returns:
- the characteristic language dependent name
-
setLanguageDependentName
public void setLanguageDependentName(java.lang.String languageDependentName)
- Specified by:
setLanguageDependentName
in interfaceCsticModel
- Parameters:
languageDependentName
- characteristic language dependent name
-
getLongText
public java.lang.String getLongText()
Description copied from interface:CsticModel
Get the long text description for a cstic, which will be displayed under the cstic name in the UI- Specified by:
getLongText
in interfaceCsticModel
- Returns:
- The long text value
-
setLongText
public void setLongText(java.lang.String longText)
Description copied from interface:CsticModel
Set the long text, which will be displayed under the Cstic name in the UI- Specified by:
setLongText
in interfaceCsticModel
- Parameters:
longText
- Description for the cstic
-
getAssignableValues
public java.util.List<CsticValueModel> getAssignableValues()
- Specified by:
getAssignableValues
in interfaceCsticModel
- Returns:
- an unmodifiable list of all assignable values
-
setAssignableValues
public void setAssignableValues(java.util.List<CsticValueModel> assignableValues)
- Specified by:
setAssignableValues
in interfaceCsticModel
- Parameters:
assignableValues
- list of all assignable values
-
getAssignedValues
public java.util.List<CsticValueModel> getAssignedValues()
- Specified by:
getAssignedValues
in interfaceCsticModel
- Returns:
- an unmodifiable list of all assigned values
-
setAssignedValues
public void setAssignedValues(java.util.List<CsticValueModel> assignedValues)
- Specified by:
setAssignedValues
in interfaceCsticModel
- Parameters:
assignedValues
- list of all assigned values
-
setAssignedValuesWithoutCheckForChange
public void setAssignedValuesWithoutCheckForChange(java.util.List<CsticValueModel> assignedValues)
Description copied from interface:CsticModel
sets assigned value without to check whether the characteristic was changed- Specified by:
setAssignedValuesWithoutCheckForChange
in interfaceCsticModel
- Parameters:
assignedValues
- list of all assigned values
-
getValueType
public int getValueType()
- Specified by:
getValueType
in interfaceCsticModel
- Returns:
- the value type
-
setValueType
public void setValueType(int valueType)
- Specified by:
setValueType
in interfaceCsticModel
- Parameters:
valueType
- value type
-
getTypeLength
public int getTypeLength()
- Specified by:
getTypeLength
in interfaceCsticModel
- Returns:
- the length of the characteristic value type
-
setTypeLength
public void setTypeLength(int typeLength)
- Specified by:
setTypeLength
in interfaceCsticModel
- Parameters:
typeLength
- length of the characteristic value type
-
getNumberScale
public int getNumberScale()
- Specified by:
getNumberScale
in interfaceCsticModel
- Returns:
- the number scale
-
setNumberScale
public void setNumberScale(int numberScale)
- Specified by:
setNumberScale
in interfaceCsticModel
- Parameters:
numberScale
- the number scale
-
isVisible
public boolean isVisible()
- Specified by:
isVisible
in interfaceCsticModel
- Returns:
- true if the characteristic is visible
-
setVisible
public void setVisible(boolean visible)
- Specified by:
setVisible
in interfaceCsticModel
- Parameters:
visible
- flag indicating whether the characteristic is visible
-
isConsistent
public boolean isConsistent()
- Specified by:
isConsistent
in interfaceCsticModel
- Returns:
- true if the characteristic is consistent
-
setConsistent
public void setConsistent(boolean consistent)
- Specified by:
setConsistent
in interfaceCsticModel
- Parameters:
consistent
- flag indicating whether the characteristic is consistent
-
isComplete
public boolean isComplete()
- Specified by:
isComplete
in interfaceCsticModel
- Returns:
- true if the characteristic is complete
-
setComplete
public void setComplete(boolean complete)
- Specified by:
setComplete
in interfaceCsticModel
- Parameters:
complete
- flag indicating whether the characteristic is complete
-
isReadonly
public boolean isReadonly()
- Specified by:
isReadonly
in interfaceCsticModel
- Returns:
- true if the characteristic is read only
-
setReadonly
public void setReadonly(boolean readonly)
- Specified by:
setReadonly
in interfaceCsticModel
- Parameters:
readonly
- flag indicating whether the characteristic is read only
-
isRequired
public boolean isRequired()
- Specified by:
isRequired
in interfaceCsticModel
- Returns:
- true if the characteristic is required
-
setRequired
public void setRequired(boolean required)
- Specified by:
setRequired
in interfaceCsticModel
- Parameters:
required
- flag indicating whether the characteristic is required
-
isMultivalued
public boolean isMultivalued()
- Specified by:
isMultivalued
in interfaceCsticModel
- Returns:
- true if the characteristic is multivalued
-
setMultivalued
public void setMultivalued(boolean multivalued)
- Specified by:
setMultivalued
in interfaceCsticModel
- Parameters:
multivalued
- flag indicating whether the characteristic is multivalued
-
isChangedByFrontend
public boolean isChangedByFrontend()
- Specified by:
isChangedByFrontend
in interfaceCsticModel
- Returns:
- true if the characteristic is changed by front end
-
setChangedByFrontend
public void setChangedByFrontend(boolean changedByFrontend)
- Specified by:
setChangedByFrontend
in interfaceCsticModel
- Parameters:
changedByFrontend
- flag indicating whether the characteristic is changed by front end
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
setSingleValue
public void setSingleValue(java.lang.String value)
Description copied from interface:CsticModel
Assigns the given value to the characteristic, overwriting any previous value assignments.
This is a typical operation for single valued characteristics.- Specified by:
setSingleValue
in interfaceCsticModel
- Parameters:
value
- the value to set
-
getValueModelForValue
protected CsticValueModel getValueModelForValue(java.lang.String valueName)
-
isValueNameMatching
protected boolean isValueNameMatching(java.lang.String value, CsticValueModel valueModel)
-
addValue
public void addValue(java.lang.String valueName)
Description copied from interface:CsticModel
Assigns the given value to the characteristic, while keeping any previous value assignments.
This is a typical operation for multi valued characteristics.- Specified by:
addValue
in interfaceCsticModel
- Parameters:
valueName
- the value to add
-
removeValue
public void removeValue(java.lang.String valueName)
Description copied from interface:CsticModel
Remove the given value from the assigned values, while keeping the other value assignments.
This is a typical operation for multi valued characteristics.- Specified by:
removeValue
in interfaceCsticModel
- Parameters:
valueName
- the value to add
-
getSingleValue
public java.lang.String getSingleValue()
Description copied from interface:CsticModel
Gets the first value of the assigned Values if existing, or null otherwise. This is a typical operation for single valued characteristics.- Specified by:
getSingleValue
in interfaceCsticModel
- Returns:
- first value of assigned values
-
clearValues
public void clearValues()
Description copied from interface:CsticModel
clears all assigned Values, same as setting an empty List as assigned value list- Specified by:
clearValues
in interfaceCsticModel
-
isAllowsAdditionalValues
public boolean isAllowsAdditionalValues()
- Specified by:
isAllowsAdditionalValues
in interfaceCsticModel
- Returns:
- true only if this characteristic allow additional values
-
getEntryFieldMask
public java.lang.String getEntryFieldMask()
- Specified by:
getEntryFieldMask
in interfaceCsticModel
- Returns:
- the characteristic entry field mask for user input
-
isIntervalInDomain
public boolean isIntervalInDomain()
- Specified by:
isIntervalInDomain
in interfaceCsticModel
- Returns:
- true if the characteristic values are intervals in domain
-
setAllowsAdditionalValues
public void setAllowsAdditionalValues(boolean allowsAdditionalValues)
- Specified by:
setAllowsAdditionalValues
in interfaceCsticModel
- Parameters:
allowsAdditionalValues
-true
, only if this characteristic allow additional values
-
setEntryFieldMask
public void setEntryFieldMask(java.lang.String entryFieldMask)
- Specified by:
setEntryFieldMask
in interfaceCsticModel
- Parameters:
entryFieldMask
- characteristic entry field mask for user input
-
setIntervalInDomain
public void setIntervalInDomain(boolean intervalInDomain)
- Specified by:
setIntervalInDomain
in interfaceCsticModel
- Parameters:
intervalInDomain
- flag indicating whether the characteristic values are intervals in domain
-
getAuthor
public java.lang.String getAuthor()
- Specified by:
getAuthor
in interfaceCsticModel
- Returns:
- the characteristic author
-
setAuthor
public void setAuthor(java.lang.String author)
- Specified by:
setAuthor
in interfaceCsticModel
- Parameters:
author
- haracteristic author
-
isConstrained
public boolean isConstrained()
- Specified by:
isConstrained
in interfaceCsticModel
- Returns:
- True if the characteristic is constrained. This means for us: It carries a static domain (at runtime this domain might be gone due to restrictable characteristics!), and no additional values are allowed
-
setConstrained
public void setConstrained(boolean constrained)
- Specified by:
setConstrained
in interfaceCsticModel
- Parameters:
constrained
- Flag indicating whether the characteristic is constrained. This means for us: It carries a static domain (at runtime this domain might be gone due to restrictable characteristics!), and no additional values are allowed
-
getStaticDomainLength
public int getStaticDomainLength()
- Specified by:
getStaticDomainLength
in interfaceCsticModel
- Returns:
- the length of the characteristic static domain
-
setStaticDomainLength
public void setStaticDomainLength(int staticDomainLength)
- Specified by:
setStaticDomainLength
in interfaceCsticModel
- Parameters:
staticDomainLength
- length of the characteristic static domain
-
getPlaceholder
public java.lang.String getPlaceholder()
- Specified by:
getPlaceholder
in interfaceCsticModel
- Returns:
- the place holder for input field
-
setPlaceholder
public void setPlaceholder(java.lang.String placeHolder)
- Specified by:
setPlaceholder
in interfaceCsticModel
- Parameters:
placeHolder
- place holder for input field
-
setInstanceId
public void setInstanceId(java.lang.String instanceId)
- Specified by:
setInstanceId
in interfaceCsticModel
- Parameters:
instanceId
- ID of corresponding instance. SeeInstanceModel.getId()
-
getInstanceId
public java.lang.String getInstanceId()
- Specified by:
getInstanceId
in interfaceCsticModel
- Returns:
- ID of corresponding instance. See
InstanceModel.getId()
-
setRetractTriggered
public void setRetractTriggered(boolean b)
- Specified by:
setRetractTriggered
in interfaceCsticModel
- Parameters:
b
- This characteristic is supposed to be retracted i.e. the user inputs are withdrawn
-
isRetractTriggered
public boolean isRetractTriggered()
- Specified by:
isRetractTriggered
in interfaceCsticModel
- Returns:
- Is this characteristic supposed to be retracted?
-
removeAssignableValue
public boolean removeAssignableValue(java.lang.String valueName)
- Specified by:
removeAssignableValue
in interfaceCsticModel
- Parameters:
valueName
- value to be removed from the list of assignable values- Returns:
- true if the value was removed from the list of assignable values
-
getMessages
public java.util.Set<ProductConfigMessage> getMessages()
- Specified by:
getMessages
in interfaceCsticModel
- Returns:
- messages valid for this characteristic
-
setMessages
public void setMessages(java.util.Set<ProductConfigMessage> messages)
- Specified by:
setMessages
in interfaceCsticModel
- Parameters:
messages
- valid for this characteristic
-
setInstanceName
public void setInstanceName(java.lang.String instanceName)
Description copied from interface:CsticModel
Sets name of hosting instance. This can be a product key or a class identifier- Specified by:
setInstanceName
in interfaceCsticModel
-
getInstanceName
public java.lang.String getInstanceName()
- Specified by:
getInstanceName
in interfaceCsticModel
- Returns:
- Name of hosting instance. This can be a product key or a class identifier
-
-