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

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

public class DeductSTRRequest
extends ModifyRequest

Represents a request to deduct value from an STR on a CM

Author:
kyleb
See Also:
Serialized Form

Nested Class Summary
static class DeductSTRRequest.DeductSTRReason
          Used for stating the reason for the STR debit taking place
 
Constructor Summary
DeductSTRRequest()
          Create a request with no intialised parameters.
DeductSTRRequest(String cardId, CardType cardType, String productName, int value)
          Sets all the required parameters with the provided values.
 
Method Summary
 DeductSTRRequest addParam(String key, Object value)
          Add a parameter to the request.
 DeductSTRRequest setCardId(String cardId)
          Set the ID of the card to load the product on to
 DeductSTRRequest setCardType(CardType cardType)
          Set the type of the card to load the product on to
 DeductSTRRequest setProductName(String productName)
          Set the name of the product to deduct value from
 DeductSTRRequest setReason(DeductSTRRequest.DeductSTRReason reason)
          Set the reason for the debit taking place
 DeductSTRRequest setValue(int value)
          Set the value to be deducted from 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

DeductSTRRequest

public DeductSTRRequest()
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)

DeductSTRRequest

public DeductSTRRequest(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 deducted from
cardType - The type of the card
productName - The name of the product
value - Value to be deducted
Method Detail

setCardId

public DeductSTRRequest 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 DeductSTRRequest 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 DeductSTRRequest 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

setReason

public DeductSTRRequest setReason(DeductSTRRequest.DeductSTRReason reason)
Set the reason for the debit taking place

Parameters:
reason - Reason for the debit taking place
Returns:
This instance to allow for method chaining

setValue

public DeductSTRRequest setValue(int value)
Set the value to be deducted from the STR

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

addParam

public DeductSTRRequest 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.