Class RewardFields

  • All Implemented Interfaces:
    android.os.Parcelable

    public class RewardFields
    extends 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 for RewardFields
      • Nested classes/interfaces inherited from interface android.os.Parcelable

        android.os.Parcelable.ClassLoaderCreator<T extends java.lang.Object>, android.os.Parcelable.Creator<T extends java.lang.Object>
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static android.os.Parcelable.Creator<RewardFields> CREATOR  
      • Fields inherited from interface android.os.Parcelable

        CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
    • 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 for RewardFields
    • 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 interface android.os.Parcelable
        Overrides:
        writeToParcel in class BaseParams