Class RewardIssuance
java.lang.Object
dev.getelements.elements.sdk.model.reward.RewardIssuance
- All Implemented Interfaces:
Taggable,Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumstatic enum -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddMetadata(String name, Object value) voidAdds a tag without performing validation of the tag string or the list of strings.static StringbuildAppleIapContextString(String originalTransactionId, String itemId, Integer skuOrdinal) Builds the context string for an Apple IAP-sourced reward issuance.static StringbuildContextString(Object... contextComponents) static StringbuildGooglePlayIapContextString(String orderId, String itemId) Builds the context string for a Google Play-sourced reward issuance.static StringbuildMissionProgressContextString(String progressId, int sequence, int rewardIndex) Builds the context string for a Mission Progression-sourced reward issuance.static StringbuildMissionProgressContextString(String progressId, String sequence, String rewardIndex) Builds the context string for a Mission Progression-sourced reward issuance.booleangetId()getItem()getState()getTags()getType()getUser()getUuid()inthashCode()voidsetContext(String context) voidsetExpirationTimestamp(Long expirationTimestamp) voidvoidvoidsetItemQuantity(Integer itemQuantity) voidsetMetadata(Map<String, Object> metadata) voidvoidsetState(RewardIssuance.State state) voidvoidsetType(RewardIssuance.Type type) voidvoidtoString()Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface dev.getelements.elements.sdk.model.Taggable
validateAndAddTag, validateAndSetTags, validateTags
-
Field Details
-
SERVER_CONTEXT_PREFIX
- See Also:
-
CONTEXT_SEPARATOR
- See Also:
-
MISSION_PROGRESS_SOURCE
- See Also:
-
APPLE_IAP_SOURCE
- See Also:
-
GOOGLE_PLAY_IAP_SOURCE
- See Also:
-
MISSION_PROGRESS_PROGRESS_KEY
- See Also:
-
MISSION_PROGRESS_STEP_KEY
- See Also:
-
-
Constructor Details
-
RewardIssuance
public RewardIssuance()
-
-
Method Details
-
getId
-
setId
-
getUser
-
setUser
-
getItem
-
setItem
-
getItemQuantity
-
setItemQuantity
-
getState
-
setState
-
getContext
-
setContext
-
getSource
-
setSource
-
getType
-
setType
-
getMetadata
-
setMetadata
-
addMetadata
-
getExpirationTimestamp
-
setExpirationTimestamp
-
getUuid
-
setUuid
-
getTags
-
setTags
-
addTag
Description copied from interface:TaggableAdds a tag without performing validation of the tag string or the list of strings. -
equals
-
hashCode
public int hashCode() -
toString
-
buildContextString
-
buildMissionProgressContextString
public static String buildMissionProgressContextString(String progressId, int sequence, int rewardIndex) Builds the context string for a Mission Progression-sourced reward issuance. The last elements in the context string are, respectively, the , the that caused the issuance, and the of the current reward in theStep's list ofRewards.- Parameters:
progressId-sequence-rewardIndex-- Returns:
- the resultant context string
-
buildMissionProgressContextString
public static String buildMissionProgressContextString(String progressId, String sequence, String rewardIndex) Builds the context string for a Mission Progression-sourced reward issuance. The last elements in the context string are, respectively, the , the that caused the issuance, and the of the current reward in theStep's list ofRewards.- Parameters:
progressId-sequence-rewardIndex-- Returns:
- the resultant context string
-
buildAppleIapContextString
public static String buildAppleIapContextString(String originalTransactionId, String itemId, Integer skuOrdinal) Builds the context string for an Apple IAP-sourced reward issuance. The last element in the context string is a hash of the , the , as well as the , i.e. the index of the product as enumerated in SKPayment.quantity (i.e. the "first" SKU to be redeemed, the "second" to be redeemed, etc.).- Parameters:
originalTransactionId-itemId-skuOrdinal-- Returns:
- the resultant context string
-
buildGooglePlayIapContextString
Builds the context string for a Google Play-sourced reward issuance. The last element in the context string is the hash of the orderId issued by the Google Play services, presumed to be universally unique, as well as the itemId.- Parameters:
orderId-itemId-- Returns:
- the resultant context string
-