Class 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 for RewardFields
      • Nested classes/interfaces inherited from class com.cheetahdigital.corekit.rest.params.BaseParams

        com.cheetahdigital.corekit.rest.params.BaseParams.BaseBuilder<T extends com.cheetahdigital.corekit.rest.params.BaseParams,​B extends com.cheetahdigital.corekit.rest.params.BaseParams.BaseBuilder>
      • 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 class com.cheetahdigital.corekit.rest.params.BaseParams

        mId, mQueryMap
      • Fields inherited from interface android.os.Parcelable

        CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.Integer getAddressId()
      Returns the address id
      java.lang.Integer getAwardId()
      Returns the award id
      java.lang.Integer getCombinationId()
      Returns the combination id
      java.lang.String getPaymentNonce()
      Returns the payment nonce
      java.lang.String getRedemptionStatus()
      Returns the redemption status
      java.lang.String getRequiredCurrency()
      Return the required currency in the parameter
      java.lang.Double getRequiredMetricValue()
      Returns the Required Metric Value
      java.lang.Integer getTargetUser()
      Returns the target user id
      java.lang.Double getTransferAmount()
      Returns the metric transfer amount
      boolean hasAddress()
      Returns the address
      boolean hasClasses()
      Returns the attribute mapping
      java.lang.Boolean isSaveAddressToProfile()
      Returns the parameter to save profile
      void saveAddressToProfile​(java.lang.Boolean shouldSave)
      Boolean parameter to let the server know that the profile must be updated
      void setAddress​(java.util.Map<java.lang.String,​java.lang.String> addressMap)
      Sets a mapping of address in the parameter
      void setAddressId​(java.lang.Integer addressId)
      Sets the address id; alternative for address mapping
      void setAwardId​(java.lang.Integer awardId)
      Sets the award id
      void setClasses​(java.util.Map<java.lang.String,​java.lang.String> classesMap)
      Sets the mapping for attribute
      void setCombinationId​(java.lang.Integer combinationId)
      Set the combination id
      void setPaymentNonce​(java.lang.String paymentNonce)
      Set the payment nonce
      void setRedemptionStatus​(java.lang.String status)
      Set the redemption status
      void setRequiredCurrency​(java.lang.String currency)
      Set the Required currency in the parameter
      void setRequiredMetricValue​(java.lang.Double metricValue)
      Sets the Required Metric Value
      void setTargetUser​(java.lang.Integer targetUserId)
      Sets the target user id where the metric will be transferred
      void setTransferAmount​(java.lang.Double transferAmount)
      Sets the amount to be transferred
      void writeToParcel​(android.os.Parcel dest, int flags)  
      • Methods inherited from class com.cheetahdigital.corekit.rest.params.BaseParams

        addParam, describeContents, getAccessToken, getId, getParam, getQueryMap, setAccessToken, setId
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • 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 com.cheetahdigital.corekit.rest.params.BaseParams