tangocard.sdk.request
Class BaseRequest

java.lang.Object
  extended by tangocard.sdk.request.BaseRequest
Direct Known Subclasses:
GetAvailableBalanceRequest, PurchaseCardRequest

public abstract class BaseRequest
extends java.lang.Object


Constructor Summary
BaseRequest(TangoCardServiceApiEnum enumTangoCardServiceApi, java.lang.String username, java.lang.String password)
          Instantiates a new base request.
 
Method Summary
<T extends SuccessResponse>
boolean
execute(T response)
          Execute.
abstract  java.lang.String getJsonEncodedRequest()
          Gets the JSON encoded request.
 java.lang.String getPassword()
          Gets the password.
abstract  java.lang.String getRequestAction()
          Gets the request action.
 TangoCardServiceApiEnum getTangoCardServiceApiEnum()
          Gets the Tango Card service api.
 java.lang.String getUsername()
          Gets the username.
 void setPassword(java.lang.String password)
          Sets the password.
 void setTangoCardServiceApiEnum(TangoCardServiceApiEnum enumTangoCardServiceApi)
          Sets the Tango Card service api.
 void setUsername(java.lang.String username)
          Sets the username.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BaseRequest

public BaseRequest(TangoCardServiceApiEnum enumTangoCardServiceApi,
                   java.lang.String username,
                   java.lang.String password)
Instantiates a new base request.

Parameters:
enumTangoCardServiceApi - the enum Tango Card service api
username - The username to access User's registered Tango Card account
password - The password to access User's registered Tango Card account
Method Detail

getRequestAction

public abstract java.lang.String getRequestAction()
Gets the request action.

Returns:
the request action

getJsonEncodedRequest

public abstract java.lang.String getJsonEncodedRequest()
                                                throws TangoCardSdkException
Gets the JSON encoded request.

Returns:
the JSON encoded request
Throws:
TangoCardSdkException

getUsername

public java.lang.String getUsername()
Gets the username.

Returns:
the username

setUsername

public void setUsername(java.lang.String username)
Sets the username.

Parameters:
username - the new username

getPassword

public java.lang.String getPassword()
Gets the password.

Returns:
the password

setPassword

public void setPassword(java.lang.String password)
Sets the password.

Parameters:
password - the new password

getTangoCardServiceApiEnum

public TangoCardServiceApiEnum getTangoCardServiceApiEnum()
Gets the Tango Card service api.

Returns:
the Tango Card service api

setTangoCardServiceApiEnum

public void setTangoCardServiceApiEnum(TangoCardServiceApiEnum enumTangoCardServiceApi)
Sets the Tango Card service api.

Parameters:
enumTangoCardServiceApi - the new Tango Card service api

execute

public <T extends SuccessResponse> boolean execute(T response)
                throws java.lang.Exception
Execute.

Type Parameters:
T - the generic type
Parameters:
response - the response
Returns:
true, if successful
Throws:
java.lang.Exception - the exception