Class TxAttributeValue

java.lang.Object
com.aquima.interactions.profile.model.TxAttributeValue
All Implemented Interfaces:
IEventChannel, IPropertyContainer, IAttributeValue, Serializable

public class TxAttributeValue extends Object implements IAttributeValue
Wrapper for the IAttributeValue that adds transaction support.
Since:
6.5
Author:
O. Kerpershoek
See Also:
  • Constructor Details

  • Method Details

    • setProperty

      public boolean setProperty(String name, IValue propertyValue)
      Description copied from interface: IPropertyContainer
      This method may be used to set the value of a property.
      Specified by:
      setProperty in interface IPropertyContainer
      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.
    • getDataType

      public DataType getDataType()
      Description copied from interface: IAttributeValue
      This method returns the data type of the value.
      Specified by:
      getDataType in interface IAttributeValue
      Returns:
      the data type of the value.
    • getDefinition

      public IAttributeDefinition getDefinition()
      Description copied from interface: IAttributeValue
      This method return the definition of this attribute.
      Specified by:
      getDefinition in interface IAttributeValue
      Returns:
      IAttributeDefinition never null
    • getDomain

      public IDomain 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 interface IAttributeValue
      Returns:
      The actual domain for this attribute.
    • getSourceType

      public SourceType 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 interface IAttributeValue
      Returns:
      SourceType identifying the source of the value.
    • getValue

      public IValue getValue()
      Description copied from interface: IAttributeValue
      This states value, as defined in IEntityInstance.getValue(String).
      Specified by:
      getValue in interface IAttributeValue
      Returns:
      IValue containing the current value of the attribute.
    • getValueReference

      public ValueReference 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 interface IAttributeValue
      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 interface IAttributeValue
      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 interface IAttributeValue
      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 interface IAttributeValue
      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 interface IAttributeValue
      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 interface IAttributeValue
      Returns:
      boolean indicating if the value of the attribute is empty.
    • getPropertyNames

      public String[] getPropertyNames()
      Description copied from interface: IPropertyContainer
      Returns the names of the properties.
      Specified by:
      getPropertyNames in interface IPropertyContainer
      Returns:
      All available properties.
    • getProperty

      public IValue getProperty(String name)
      Description copied from interface: IPropertyContainer
      This method will return the value of the specified property.
      Specified by:
      getProperty in interface IPropertyContainer
      Parameters:
      name - The name of the property whose value is requested.
      Returns:
      The value of the property.
    • hasProperty

      public boolean hasProperty(String name)
      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 interface IPropertyContainer
      Parameters:
      name - The name of the property that should be checked.
      Returns:
      boolean indicating if a property with the specified name is present.
    • 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 interface IEventChannel
      Returns:
      Bit-mask containing the event types that are supported by this event channel.
    • addEventListener

      public boolean addEventListener(IEventListener listener)
      Description copied from interface: IEventChannel
      This method will add the passed event listener to the list of listeners.
      Specified by:
      addEventListener in interface IEventChannel
      Parameters:
      listener - The event listener that should be added.
      Returns:
      boolean indicating is the listener was actually added.
    • removeEventListener

      public boolean removeEventListener(IEventListener listener)
      Description copied from interface: IEventChannel
      This method will remove the specified event listener from the list of listeners.
      Specified by:
      removeEventListener in interface IEventChannel
      Parameters:
      listener - The event listener that should be removed.
      Returns:
      boolean indicating if the listener was actually removed.
    • setAttachment

      public void setAttachment(String key, Serializable attachment)
      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 is Serializable
      For a null key, nothing will be set
      Specified by:
      setAttachment in interface IAttributeValue
      Parameters:
      key - the key for which to set the attachment
      attachment - - the Serializable attachment to be stored
    • getAttachment

      public Serializable getAttachment(String key)
      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 interface IAttributeValue
      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