Class RewardFields
- java.lang.Object
-
- com.cheetahdigital.corekit.rest.params.BaseParams
-
- com.cheetahdigital.rewards.core.api.RewardFields
-
- All Implemented Interfaces:
android.os.Parcelable
public class RewardFields extends com.cheetahdigital.corekit.rest.params.BaseParams
Class that handles all field parameters for Rewards
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
RewardFields.Builder
Builder class forRewardFields
-
Field Summary
Fields Modifier and Type Field Description static android.os.Parcelable.Creator<RewardFields>
CREATOR
-
Constructor Summary
Constructors Constructor Description RewardFields()
Constructor forRewardFields
RewardFields(android.os.Parcel in)
Constructor with Parcel parameter
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Integer
getAddressId()
Returns the address idjava.lang.Integer
getAwardId()
Returns the award idjava.lang.Integer
getCombinationId()
Returns the combination idjava.lang.String
getPaymentNonce()
Returns the payment noncejava.lang.String
getRedemptionStatus()
Returns the redemption statusjava.lang.String
getRequiredCurrency()
Return the required currency in the parameterjava.lang.Double
getRequiredMetricValue()
Returns the Required Metric Valuejava.lang.Integer
getTargetUser()
Returns the target user idjava.lang.Double
getTransferAmount()
Returns the metric transfer amountboolean
hasAddress()
Returns the addressboolean
hasClasses()
Returns the attribute mappingjava.lang.Boolean
isSaveAddressToProfile()
Returns the parameter to save profilevoid
saveAddressToProfile(java.lang.Boolean shouldSave)
Boolean parameter to let the server know that the profile must be updatedvoid
setAddress(java.util.Map<java.lang.String,java.lang.String> addressMap)
Sets a mapping of address in the parametervoid
setAddressId(java.lang.Integer addressId)
Sets the address id; alternative for address mappingvoid
setAwardId(java.lang.Integer awardId)
Sets the award idvoid
setClasses(java.util.Map<java.lang.String,java.lang.String> classesMap)
Sets the mapping for attributevoid
setCombinationId(java.lang.Integer combinationId)
Set the combination idvoid
setPaymentNonce(java.lang.String paymentNonce)
Set the payment noncevoid
setRedemptionStatus(java.lang.String status)
Set the redemption statusvoid
setRequiredCurrency(java.lang.String currency)
Set the Required currency in the parametervoid
setRequiredMetricValue(java.lang.Double metricValue)
Sets the Required Metric Valuevoid
setTargetUser(java.lang.Integer targetUserId)
Sets the target user id where the metric will be transferredvoid
setTransferAmount(java.lang.Double transferAmount)
Sets the amount to be transferredvoid
writeToParcel(android.os.Parcel dest, int flags)
-
-
-
Field Detail
-
CREATOR
public static final android.os.Parcelable.Creator<RewardFields> CREATOR
-
-
Constructor Detail
-
RewardFields
public RewardFields(android.os.Parcel in)
Constructor with Parcel parameter- Parameters:
in
- parcel parameter
-
RewardFields
public RewardFields()
Constructor forRewardFields
-
-
Method Detail
-
getRequiredMetricValue
@Nullable public java.lang.Double getRequiredMetricValue()
Returns the Required Metric Value- Returns:
- double - value of the required metric value
-
setRequiredMetricValue
public void setRequiredMetricValue(@Nullable java.lang.Double metricValue)
Sets the Required Metric Value- Parameters:
metricValue
- double, value of the required metric value
-
getRequiredCurrency
@Nullable public java.lang.String getRequiredCurrency()
Return the required currency in the parameter- Returns:
- String - required currency for the Reward
-
setRequiredCurrency
public void setRequiredCurrency(@Nullable java.lang.String currency)
Set the Required currency in the parameter- Parameters:
currency
- String - required currency for the Reward
-
hasAddress
public boolean hasAddress()
Returns the address- Returns:
- mapping of address
-
setAddress
public void setAddress(java.util.Map<java.lang.String,java.lang.String> addressMap)
Sets a mapping of address in the parameter- Parameters:
addressMap
- address mapping - Map (Key, Value)
-
getAddressId
@Nullable public java.lang.Integer getAddressId()
Returns the address id- Returns:
- id of the address
-
setAddressId
public void setAddressId(@Nullable java.lang.Integer addressId)
Sets the address id; alternative for address mapping- Parameters:
addressId
- id of the address
-
saveAddressToProfile
public void saveAddressToProfile(@Nullable java.lang.Boolean shouldSave)
Boolean parameter to let the server know that the profile must be updated- Parameters:
shouldSave
- true to enable server update on the profile, else false
-
isSaveAddressToProfile
@Nullable public java.lang.Boolean isSaveAddressToProfile()
Returns the parameter to save profile- Returns:
- boolean - if to save the address to profile
-
getCombinationId
@Nullable public java.lang.Integer getCombinationId()
Returns the combination id- Returns:
- int - combination id of the reward configuration
-
setCombinationId
public void setCombinationId(@Nullable java.lang.Integer combinationId)
Set the combination id- Parameters:
combinationId
- int - combination id of the selected reward configuration
-
hasClasses
public boolean hasClasses()
Returns the attribute mapping- Returns:
- boolean - true if the
RewardFields
has reward classes
-
setClasses
public void setClasses(java.util.Map<java.lang.String,java.lang.String> classesMap)
Sets the mapping for attribute- Parameters:
classesMap
- mapping of reward attributes
-
getAwardId
@Nullable public java.lang.Integer getAwardId()
Returns the award id- Returns:
- int - returns the award id
-
setAwardId
public void setAwardId(@Nullable java.lang.Integer awardId)
Sets the award id- Parameters:
awardId
- value for award id
-
getPaymentNonce
@Nullable public java.lang.String getPaymentNonce()
Returns the payment nonce- Returns:
- current value for payment_nonce parameter
-
setPaymentNonce
public void setPaymentNonce(@Nullable java.lang.String paymentNonce)
Set the payment nonce- Parameters:
paymentNonce
- value to set for payment_nonce parameter
-
getRedemptionStatus
@Nullable public java.lang.String getRedemptionStatus()
Returns the redemption status- Returns:
- current value for redemption_status parameter
-
setRedemptionStatus
public void setRedemptionStatus(@Nullable java.lang.String status)
Set the redemption status- Parameters:
status
- value to set for redemption_status parameter
-
getTransferAmount
@Nullable public java.lang.Double getTransferAmount()
Returns the metric transfer amount- Returns:
- current value for metric_value parameter
-
setTransferAmount
public void setTransferAmount(@Nullable java.lang.Double transferAmount)
Sets the amount to be transferred- Parameters:
transferAmount
- value to set for metric_value parameter
-
getTargetUser
@Nullable public java.lang.Integer getTargetUser()
Returns the target user id- Returns:
- current value for target_user_id parameter
-
setTargetUser
public void setTargetUser(@Nullable java.lang.Integer targetUserId)
Sets the target user id where the metric will be transferred- Parameters:
targetUserId
- current value to set for target_user_id parameter
-
writeToParcel
public void writeToParcel(android.os.Parcel dest, int flags)
- Specified by:
writeToParcel
in interfaceandroid.os.Parcelable
- Overrides:
writeToParcel
in classcom.cheetahdigital.corekit.rest.params.BaseParams
-
-