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

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

public class AddStoredUseRequest
extends ModifyRequest

Represents a request to add a number of stored uses to a product on a CM

Author:
kyleb
See Also:
Serialized Form

Constructor Summary
AddStoredUseRequest()
          Create a request with no initialised parameters.
AddStoredUseRequest(String cardId, CardType cardType, String identifier, String productName, int numUses)
          Sets all the required parameters with the provided values.
 
Method Summary
 AddStoredUseRequest addParam(String key, Object value)
          Add a parameter to the request.
 AddStoredUseRequest setCardId(String cardId)
          Set the ID of the card to modify
 AddStoredUseRequest setCardType(CardType cardType)
          Set the type of the card to modify
 AddStoredUseRequest setIdentifierId(String identifier)
          Set the details of the ISAM that created the product
 AddStoredUseRequest setProductName(String productName)
          Set the name of the product to add stored uses to
 AddStoredUseRequest setUses(int numUses)
          Set the uses to be added to the product
 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

AddStoredUseRequest

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

AddStoredUseRequest

public AddStoredUseRequest(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 added to
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 added
Method Detail

setCardId

public AddStoredUseRequest 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 AddStoredUseRequest 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 AddStoredUseRequest setProductName(String productName)
Set the name of the product to add stored uses to

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

setUses

public AddStoredUseRequest setUses(int numUses)
Set the uses to be added to the product

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

addParam

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