Package com.aquima.interactions.rule.tms
Class TmsAttributeState
java.lang.Object
com.aquima.interactions.rule.tms.TmsAttributeState
- All Implemented Interfaces:
IEventChannel
,IPropertyContainer
,IAttributeValue
,Serializable
This class wraps an attribute value to add TMS behavior.
- Since:
- 5.0
- Author:
- O. Kerpershoek, A. Pragt
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
TmsAttributeState
(TmsProfile profile, IAttributeValue profileState) -
Method Summary
Modifier and TypeMethodDescriptionboolean
addEventListener
(IEventListener listener) This method will add the passed event listener to the list of listeners.getAttachment
(String key) Returns the available attachment that this attribute value has and is located at the specified key, otherwise returns nullThis method returns the data type of the value.This method return the definition of this attribute.This method returns the domain (set of values) that is currently valid for the attribute.getProperty
(String name) This method will return the value of the specified property.String[]
Returns the names of the properties.This method returns the source type of the value.int
This method returns a bit-mask containing all event types that are supported by this event channel.getValue()
This states value, as defined inIEntityInstance.getValue(String)
.This method return an object containing a reference to this attribute value.boolean
This method returns a boolean indicating if this value consists of multiple primitive values.boolean
hasProperty
(String name) This method will return a boolean indicating if a property with the specified name is present.boolean
This method returns a boolean indicating if the attribute holds exactly one value.boolean
This method returns a boolean indicating if the attributes has been assigned a value.boolean
This method returns a boolean indicating if the attribute can have multiple values.boolean
boolean
This method can be used to determine if the value of the attribute is empty.boolean
removeEventListener
(IEventListener listener) This method will remove the specified event listener from the list of listeners.void
setAttachment
(String key, Serializable attachment) Associates the specified value with the specified key in the attachments map.boolean
setProperty
(String name, IValue propertyValue) This method may be used to set the value of a property.
-
Constructor Details
-
TmsAttributeState
-
-
Method Details
-
getDomain
Description copied from interface:IAttributeValue
This method returns the domain (set of values) that is currently valid for the attribute. This domain will hold at most all values from the domain definition, but this domain may also be empty when there is no value valid in the current context. The domain definition for this attribute may be requested through this domain, or by using the getDomain method from the attribute definition. This method may return null for attributes that don't have a domain.- Specified by:
getDomain
in interfaceIAttributeValue
- Returns:
- The actual domain for this attribute.
-
getDataType
Description copied from interface:IAttributeValue
This method returns the data type of the value.- Specified by:
getDataType
in interfaceIAttributeValue
- Returns:
- the data type of the value.
-
getDefinition
Description copied from interface:IAttributeValue
This method return the definition of this attribute.- Specified by:
getDefinition
in interfaceIAttributeValue
- Returns:
- IAttributeDefinition never null
-
getSourceType
Description copied from interface:IAttributeValue
This method returns the source type of the value. The source type can be used to identify how the attribute got it's value.- Specified by:
getSourceType
in interfaceIAttributeValue
- Returns:
- SourceType identifying the source of the value.
-
getValue
Description copied from interface:IAttributeValue
This states value, as defined inIEntityInstance.getValue(String)
.- Specified by:
getValue
in interfaceIAttributeValue
- Returns:
- IValue containing the current value of the attribute.
-
getValueReference
Description copied from interface:IAttributeValue
This method return an object containing a reference to this attribute value. The method is available to simplify interaction with legacy components using the old profile interface.- Specified by:
getValueReference
in interfaceIAttributeValue
- Returns:
- ValueReference object containing various ids needed to locate this specific attribute value.
-
hasMultipleValues
public boolean hasMultipleValues()Description copied from interface:IAttributeValue
This method returns a boolean indicating if this value consists of multiple primitive values. When this value is unknown or only represents a single value, this method will return false.- Specified by:
hasMultipleValues
in interfaceIAttributeValue
- Returns:
- boolean indicating if this value contains multiple primitive values.
-
hasSingleValue
public boolean hasSingleValue()Description copied from interface:IAttributeValue
This method returns a boolean indicating if the attribute holds exactly one value.- Specified by:
hasSingleValue
in interfaceIAttributeValue
- Returns:
- boolean indicating if the attribute holds exactly one value.
-
isAnswered
public boolean isAnswered()Description copied from interface:IAttributeValue
This method returns a boolean indicating if the attributes has been assigned a value.- Specified by:
isAnswered
in interfaceIAttributeValue
- Returns:
- boolean indicating if the attributes has been assigned a value.
-
isMultiValue
public boolean isMultiValue()Description copied from interface:IAttributeValue
This method returns a boolean indicating if the attribute can have multiple values. Use the hasMultipleValues or hasSingleValue to determine if the attribute actually hold multiple values.- Specified by:
isMultiValue
in interfaceIAttributeValue
- Returns:
- boolean indicating if the attribute can hold multiple values.
-
isUnknown
public boolean isUnknown()Description copied from interface:IAttributeValue
This method can be used to determine if the value of the attribute is empty. Note: An empty attribute can still be answered.- Specified by:
isUnknown
in interfaceIAttributeValue
- Returns:
- boolean indicating if the value of the attribute is empty.
-
getPropertyNames
Description copied from interface:IPropertyContainer
Returns the names of the properties.- Specified by:
getPropertyNames
in interfaceIPropertyContainer
- Returns:
- All available properties.
-
getProperty
Description copied from interface:IPropertyContainer
This method will return the value of the specified property.- Specified by:
getProperty
in interfaceIPropertyContainer
- Parameters:
name
- The name of the property whose value is requested.- Returns:
- The value of the property.
-
hasProperty
Description copied from interface:IPropertyContainer
This method will return a boolean indicating if a property with the specified name is present.- Specified by:
hasProperty
in interfaceIPropertyContainer
- Parameters:
name
- The name of the property that should be checked.- Returns:
- boolean indicating if a property with the specified name is present.
-
setProperty
Description copied from interface:IPropertyContainer
This method may be used to set the value of a property.- Specified by:
setProperty
in interfaceIPropertyContainer
- Parameters:
name
- The name of the property whose value should be set.propertyValue
- The new value of the property.- Returns:
- boolean indicating if the set operation was successful.
-
addEventListener
Description copied from interface:IEventChannel
This method will add the passed event listener to the list of listeners.- Specified by:
addEventListener
in interfaceIEventChannel
- Parameters:
listener
- The event listener that should be added.- Returns:
- boolean indicating is the listener was actually added.
-
getSupportedEvents
public int getSupportedEvents()Description copied from interface:IEventChannel
This method returns a bit-mask containing all event types that are supported by this event channel. The bit-mask is a bitwise OR of the diverse event types. To check whether a specific event-listener is supported, you can do the following:// This checks if a VALUE listener is supported if ((channel.getSupportedEvents() & IEvent.Mask.VALUE) != 0) { // VALUE event listeners that are supported }
- Specified by:
getSupportedEvents
in interfaceIEventChannel
- Returns:
- Bit-mask containing the event types that are supported by this event channel.
-
removeEventListener
Description copied from interface:IEventChannel
This method will remove the specified event listener from the list of listeners.- Specified by:
removeEventListener
in interfaceIEventChannel
- Parameters:
listener
- The event listener that should be removed.- Returns:
- boolean indicating if the listener was actually removed.
-
isTmsAnswered
public boolean isTmsAnswered() -
setAttachment
Description copied from interface:IAttributeValue
Associates the specified value with the specified key in the attachments map. If the map previously contained a mapping for the key, the old value is replaced. An attachment can be anything as long as it isSerializable
For a null key, nothing will be set- Specified by:
setAttachment
in interfaceIAttributeValue
- Parameters:
key
- the key for which to set the attachmentattachment
- - theSerializable
attachment to be stored
-
getAttachment
Description copied from interface:IAttributeValue
Returns the available attachment that this attribute value has and is located at the specified key, otherwise returns null- Specified by:
getAttachment
in interfaceIAttributeValue
- Parameters:
key
- the key for with to return the value for- Returns:
- the
Serializable
object that is stored at the specified key, if nothing found for the key,null
is returned
-