com.ibm.commerce.payments.plugin

Class ExtendedData

  • java.lang.Object
    • com.ibm.commerce.payments.plugin.ExtendedData
  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable


    public class ExtendedData
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable

    This class is a value object container that aggregates non-standard protocol data required in financial transactions(FinancialTransaction).

    Plug-ins require extra protocol data that goes beyond the standard attributes defined in the PaymentInstruction definition. These extra attributes are passed down from the Payment Plug-in Controller to the plug-in by means of the ExtendedData.

    When associated with a PaymentInstruction, the ExtendedData is meant to be used (potentially) by all FinancialTransactions executed against the same PaymentInstruction container.

    However, ExtendedData can also be attached to a particular FinancialTransaction. In this case, the extra attribute are only used in that same FinancialTransaction. Subsequent financial transactions could reuse the contents of ExtendedData if they are related to a previous FinancialTransaction container.

    See Also:
    PaymentInstruction, FinancialTransaction, Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      ExtendedData()
      This method creates an empty ExtendedData object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      java.lang.Object clone()
      This method returns a shallow copy of this ExtendedData instance: the keys and values themselves are not cloned.
      java.math.BigDecimal getBigDecimal(java.lang.String name)
      This method gets the decimal value associated with the specified attribute.
      java.lang.StringBuffer getBinary(java.lang.String name)
      This method gets the binary value associated with the specified attribute.
      java.lang.Boolean getBoolean(java.lang.String name)
      This method gets the boolean value associated with the specified attribute.
      boolean getEncryptionRequiredFlag(java.lang.String name)
      This method gets the encryption required flag for the specified attribute (name).
      java.util.HashMap getExtendedDataAsHashMap()
      This method gets a hash map that contains all name-value pairs.
      java.lang.Integer getInteger(java.lang.String name)
      This method gets the integer value associated with the specified attribute.
      java.lang.Long getLong(java.lang.String name)
      This method gets the long value associated with the specified attribute.
      java.lang.String getString(java.lang.String name)
      This method gets the string value associated with the specified attribute.
      short getType(java.lang.String name)
      This method gets the type of the value associated with the specified attribute (name).
      void remove(java.lang.String name)
      This method removes the name-value pair with the specified name.
      void setBigDecimal(java.lang.String name, java.math.BigDecimal value, boolean encrypted)
      This method sets a name-value pair where the value is a BigDecimal.
      void setBinary(java.lang.String name, java.lang.StringBuffer value, boolean encrypted)
      This method sets a name-value pair where the value is binary data (StringBuffer).
      void setBoolean(java.lang.String name, java.lang.Boolean value, boolean encrypted)
      This method sets a name-value pair where the value is a Boolean.
      void setInteger(java.lang.String name, java.lang.Integer value, boolean encrypted)
      This method sets a name-value pair where the value is an Integer.
      void setLong(java.lang.String name, java.lang.Long value, boolean encrypted)
      This method sets a name-value pair where the value is a Long.
      void setString(java.lang.String name, java.lang.String value, boolean encrypted)
      This method sets a name-value pair where the value is a String.
      java.lang.String toString()
      This method obtains a human-readable representation of the ExtendedData.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • ExtendedData

        public ExtendedData()
        This method creates an empty ExtendedData object.
    • Method Detail

      • setBigDecimal

        public void setBigDecimal(java.lang.String name,
                                  java.math.BigDecimal value,
                                  boolean encrypted)

        This method sets a name-value pair where the value is a BigDecimal.

        Parameters:
        name - The attribute name.
        value - The decimal value that needs to be stored.
        encrypted - If the value needs to be encrypted when stored.
      • getBigDecimal

        public java.math.BigDecimal getBigDecimal(java.lang.String name)

        This method gets the decimal value associated with the specified attribute. If the value is stored encrypted, this method will not provide additional logic to decrypt the value.

        Parameters:
        name - The attribute name.
        Returns:
        The decimal value associated with the attribute, if any.
      • setBinary

        public void setBinary(java.lang.String name,
                              java.lang.StringBuffer value,
                              boolean encrypted)

        This method sets a name-value pair where the value is binary data (StringBuffer).

        Parameters:
        name - The attribute name.
        value - The binary value that needs to be stored.
        encrypted - If the value needs to be encrypted when stored.
      • getBinary

        public java.lang.StringBuffer getBinary(java.lang.String name)

        This method gets the binary value associated with the specified attribute. If the value is stored encrypted, this method will not provide additional logic to decrypt the value.

        Parameters:
        name - The attribute name.
        Returns:
        The binary value associated with the attribute, if any.
      • setBoolean

        public void setBoolean(java.lang.String name,
                               java.lang.Boolean value,
                               boolean encrypted)

        This method sets a name-value pair where the value is a Boolean.

        Parameters:
        name - The attribute name.
        value - The boolean value that needs to be stored.
        encrypted - If the value needs to be encrypted when stored.
      • getBoolean

        public java.lang.Boolean getBoolean(java.lang.String name)

        This method gets the boolean value associated with the specified attribute. If the value is stored encrypted, this method will not provide additional logic to decrypt the value.

        Parameters:
        name - The attribute name.
        Returns:
        Boolean value associated with the attribute, if any.
      • getEncryptionRequiredFlag

        public boolean getEncryptionRequiredFlag(java.lang.String name)

        This method gets the encryption required flag for the specified attribute (name).

        Parameters:
        name - The attribute name.
        Returns:
        If the encryption is required or not, if any.
      • getExtendedDataAsHashMap

        public java.util.HashMap getExtendedDataAsHashMap()

        This method gets a hash map that contains all name-value pairs. Each element of the hash map is composed of the attribute name and its value NameValueObject.

        If the value is stored encrypted, this method will not provide additional logic to decrypt the value.

        Returns:
        The map containing all of the name-value pairs.
      • setInteger

        public void setInteger(java.lang.String name,
                               java.lang.Integer value,
                               boolean encrypted)

        This method sets a name-value pair where the value is an Integer.

        Parameters:
        name - The attribute name.
        value - The integer value that needs to be stored.
        encrypted - If the value needs to be encrypted when stored.
      • getInteger

        public java.lang.Integer getInteger(java.lang.String name)

        This method gets the integer value associated with the specified attribute. If the value is stored encrypted, this method will not provide additional logic to decrypt the value.

        Parameters:
        name - The attribute name.
        Returns:
        Integer value associated with the specified attribute, if any.
      • setLong

        public void setLong(java.lang.String name,
                            java.lang.Long value,
                            boolean encrypted)

        This method sets a name-value pair where the value is a Long.

        Parameters:
        name - The attribute name.
        value - The long value that needs to be stored.
        encrypted - If the value needs to be encrypted when stored.
      • getLong

        public java.lang.Long getLong(java.lang.String name)

        This method gets the long value associated with the specified attribute. If the value is stored encrypted, this method will not provide additional logic to decrypt the value.

        Parameters:
        name - The attribute name.
        Returns:
        Long value associated with the specified attribute, if any.
      • getType

        public short getType(java.lang.String name)

        This method gets the type of the value associated with the specified attribute (name).

        Parameters:
        name - the attribute name.
        Returns:
        The type of the value as specified in NameValueObject.
      • setString

        public void setString(java.lang.String name,
                              java.lang.String value,
                              boolean encrypted)

        This method sets a name-value pair where the value is a String.

        Parameters:
        name - The attribute name.
        value - The string value that needs to be stored.
        encrypted - If the value needs to be encrypted when stored.
      • getString

        public java.lang.String getString(java.lang.String name)

        This method gets the string value associated with the specified attribute. If the value is stored encrypted, this method will not provide additional logic to decrypt the value.

        Parameters:
        name - The attribute name.
        Returns:
        String value associate to the specified attribute.
      • remove

        public void remove(java.lang.String name)

        This method removes the name-value pair with the specified name.

        Parameters:
        name - The name-value pair to be removed.
      • toString

        public java.lang.String toString()

        This method obtains a human-readable representation of the ExtendedData.

        Overrides:
        toString in class java.lang.Object
        Returns:
        A human-readable representation of the ExtendedData.
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException

        This method returns a shallow copy of this ExtendedData instance: the keys and values themselves are not cloned.

        Overrides:
        clone in class java.lang.Object
        Returns:
        A shallow copy of this ExtendedData instance.
        Throws:
        java.lang.CloneNotSupportedException - If the instance cannot be cloned.