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

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

public class DeductStoredUseRequest
extends ModifyRequest

Represents a request to deduct a number of stored uses from a product on a CM

Author:
kyleb
See Also:
Serialized Form

Nested Class Summary
static class DeductStoredUseRequest.DeductStoredUseReason
           
 
Constructor Summary
DeductStoredUseRequest()
          Create a request with no initialised parameters.
DeductStoredUseRequest(String cardId, CardType cardType, String identifier, String productName, int numUses)
          Sets all the required parameters with the provided values.
 
Method Summary
 DeductStoredUseRequest addParam(String key, Object value)
          Add a parameter to the request.
 DeductStoredUseRequest setCardId(String cardId)
          Set the ID of the card to modify
 DeductStoredUseRequest setCardType(CardType cardType)
          Set the type of the card to modify
 DeductStoredUseRequest setIdentifierId(String identifier)
          Set the details of the ISAM that created the product
 DeductStoredUseRequest setProductName(String productName)
          Set the name of the product to deduct stored uses from
 DeductStoredUseRequest setReason(DeductStoredUseRequest.DeductStoredUseReason reason)
          Set the reason for the debit taking place
 DeductStoredUseRequest setUses(int uses)
          Set the number of stored uses to deduct
 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

DeductStoredUseRequest

public DeductStoredUseRequest()
Create a request with no initialised 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), setUses(int), setIdentifierId(String), setProductName(String)

DeductStoredUseRequest

public DeductStoredUseRequest(String cardId,
                              CardType cardType,
                              String identifier,
                              String productName,
                              int numUses)
Sets all the required parameters with the provided values.

Parameters:
cardId - ID of the card with the product that stored uses should be deducted from
cardType - The type of the card
identifier - The identifier of the ISAM that created the product
productName - The name of the product
numUses - The number of stored uses to be deducted
Method Detail

setCardId

public DeductStoredUseRequest setCardId(String cardId)
Set the ID of the card to modify

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

setCardType

public DeductStoredUseRequest setCardType(CardType cardType)
Set the type of the card to modify

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

setProductName

public DeductStoredUseRequest setProductName(String productName)
Set the name of the product to deduct stored uses from

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

setUses

public DeductStoredUseRequest setUses(int uses)
Set the number of stored uses to deduct

Parameters:
numUses - Number of stored uses to deduct
Returns:
This instance to allow for method chaining

setReason

public DeductStoredUseRequest setReason(DeductStoredUseRequest.DeductStoredUseReason 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

addParam

public DeductStoredUseRequest addParam(String key,
                                       Object value)
Add a parameter to the request. These are optional fields and the required fields will be specific to each application.

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

setIdentifierId

public DeductStoredUseRequest setIdentifierId(String identifier)
Set the details of the ISAM that created the product

Parameters:
identifier - The identifier of the ISAM that created the product to be updated.
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.