-
public final class CfLogRewardEvent.BuilderCfLogRewardEvent is to log the reward related events for user, which includes viewing, redeeming, adding.
-
-
Constructor Summary
Constructors Constructor Description CfLogRewardEvent.Builder(String reward_id, String action_value, Float acc_points, Float total_points, RedeemObject redeem_object, Float usd_rate, Boolean isCashEvent, Object meta, Boolean update_immediately)
-
Method Summary
Modifier and Type Method Description final <ERROR CLASS>setRewardId(String reward_id)setRewardId is for the providing Id for the reward event. final <ERROR CLASS>setAction(RewardAction action)setAction is required to set the Action type for the Reward Action. final <ERROR CLASS>setAction(String action)final <ERROR CLASS>setAccumulatedPoints(Float acc_points)setAccumulatedPoints is for the providing achieved points in case of add reward event. final <ERROR CLASS>setTotalPoints(Float total_points)setTotalPoints logs the total points achieved so far by the user. final <ERROR CLASS>setRedeemObject(RedeemObject redeem_object)setRedeemObject is for the providing details about reward redeeming. final <ERROR CLASS>setRedeemObject(String redeem_object)final <ERROR CLASS>setMeta(Object meta)You can pass any type of value in setMeta. final <ERROR CLASS>updateImmediately(Boolean update_immediately)updateImmediately is responsible for updating the values ot the backend immediately. final <ERROR CLASS>build()build will validate all of the values provided and if passes will call the track function and queue the events based on it's updateImmediately value and also on the user's network resources. -
-
Method Detail
-
setRewardId
final <ERROR CLASS> setRewardId(String reward_id)
setRewardId is for the providing Id for the reward event. Can be userId if the reward is not redeemed individually.
-
setAction
final <ERROR CLASS> setAction(RewardAction action)
setAction is required to set the Action type for the Reward Action. SDK provides enum classes to support available log types. 1 main is achieved. SDK provides 2 approaches to log this event, one being enum type and the other is string type.
-
setAccumulatedPoints
final <ERROR CLASS> setAccumulatedPoints(Float acc_points)
setAccumulatedPoints is for the providing achieved points in case of add reward event.
-
setTotalPoints
final <ERROR CLASS> setTotalPoints(Float total_points)
setTotalPoints logs the total points achieved so far by the user.
-
setRedeemObject
final <ERROR CLASS> setRedeemObject(RedeemObject redeem_object)
setRedeemObject is for the providing details about reward redeeming. The object should be based on the RedeemObject or a string that can be converted to the object with proper param names. in-case the names are not correct the SDK will throw an exception. Below is the function for providing item as a string.
-
setRedeemObject
final <ERROR CLASS> setRedeemObject(String redeem_object)
-
setMeta
final <ERROR CLASS> setMeta(Object meta)
You can pass any type of value in setMeta. It is for developer and partners to log additional information with the log that they find would be helpful for logging and providing more context to the log. Default value for the meta is null.
-
updateImmediately
final <ERROR CLASS> updateImmediately(Boolean update_immediately)
updateImmediately is responsible for updating the values ot the backend immediately. By default this is set to false or whatever the developer has set in the SDK initialisation block. This differs the time for which the logs will be logged, if true, the SDK will log the content instantly and if false it will wait till the end of user session which is whenever the app goes into background.
-
build
final <ERROR CLASS> build()
build will validate all of the values provided and if passes will call the track function and queue the events based on it's updateImmediately value and also on the user's network resources.
-
-
-
-