com.ecebs.rtd.enabler.types.request
Class AddSTRRequest

java.lang.Object
  extended by com.ecebs.rtd.enabler.types.request.ModifyRequest
      extended by com.ecebs.rtd.enabler.types.request.AddSTRRequest
All Implemented Interfaces:
Request, Serializable

public class AddSTRRequest
extends ModifyRequest

Represents a request to add value to an STR on a CM

Author:
kyleb
See Also:
Serialized Form

Constructor Summary
AddSTRRequest()
          Create a request with no intialised parameters.
AddSTRRequest(String cardId, CardType cardType, String productName, int value)
          Sets all the required parameters with the provided values.
 
Method Summary
 AddSTRRequest addParam(String key, Object value)
          Add a parameter to the request.
 AddSTRRequest setCardId(String cardId)
          Set the ID of the card to load the product on to
 AddSTRRequest setCardType(CardType cardType)
          Set the type of the card to load the product on to
 AddSTRRequest setProductName(String productName)
          Set the name of the product to deduct value from
 AddSTRRequest setValue(int value)
          Set the value to be added to the STR
 Outcome validate()
          Validate that the required fields have been set
 
Methods inherited from class com.ecebs.rtd.enabler.types.request.ModifyRequest
getCardId, getCardType, getRequestId, setRequestId
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AddSTRRequest

public AddSTRRequest()
Create a request with no intialised parameters. All of the required parameters must be set before using this request for an operation. Methods for setting required parameters start with "set"

See Also:
setCardId(String), setCardType(CardType), setProductName(String), setValue(int)

AddSTRRequest

public AddSTRRequest(String cardId,
                     CardType cardType,
                     String productName,
                     int value)
Sets all the required parameters with the provided values.

Parameters:
cardId - ID of the card with the product that value should be added to
cardType - The type of the card
productName - The name of the product
value - Value to be added
Method Detail

setCardId

public AddSTRRequest setCardId(String cardId)
Set the ID of the card to load the product on to

Parameters:
cardId - ID of the card to load the product on to
Returns:
This instance to allow for method chaining

setCardType

public AddSTRRequest setCardType(CardType cardType)
Set the type of the card to load the product on to

Parameters:
cardType - Type of the card to load the product on to
Returns:
This instance to allow for method chaining

setProductName

public AddSTRRequest setProductName(String productName)
Set the name of the product to deduct value from

Parameters:
productName - Name of the product to deduct value from
Returns:
This instance to allow for method chaining

setValue

public AddSTRRequest setValue(int value)
Set the value to be added to the STR

Parameters:
value - The value to be added
Returns:
This instance to allow for method chaining

addParam

public AddSTRRequest addParam(String key,
                              Object value)
Description copied from class: ModifyRequest
Add a parameter to the request. These are optional fields and the required fields will be specific to each application. The provided value will be converted by calling Object.toString()

Specified by:
addParam in class ModifyRequest
Parameters:
key - The key for the parameter
value - The value of the parameter
Returns:
This instance to allow for method chaining

validate

public Outcome validate()
Description copied from interface: Request
Validate that the required fields have been set

Specified by:
validate in interface Request
Overrides:
validate in class ModifyRequest
Returns:
An outcome if the validation failed, else null


Copyright © 2013 Ecebs Ltd. All Rights Reserved.