public final class BadgeProgressImpl extends java.lang.Object implements BadgeProgress
Constructor and Description |
---|
BadgeProgressImpl(double progress,
int timesCompleted,
int completedConditionsCount,
java.util.Map<java.lang.String,ConditionProgress> conditionsProgress,
java.util.Date completedDate,
java.util.Map<java.lang.String,RewardProgress> rewardProgress) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
int |
getCompletedConditionsCount()
The number of conditions completed
|
java.util.Date |
getCompletedDate()
The latest date the badge was completed on.
|
java.util.Map<java.lang.String,ConditionProgress> |
getConditionsProgress()
The badge's conditions progress
|
double |
getProgress()
The user’s badge progress, as a number between 0 and 1.
|
java.util.Map<java.lang.String,RewardProgress> |
getRewardProgress()
Map of the badge rewards (key: reward ID, value: RewardProgress obejct)
When you want to know if a reward has already been claimed (therefor there's no need to show
a 'claim!' dialog to the user, for example) you can get the rewardsProgress Map from the badgeProgress object
and use the .isClaimed() function.
|
int |
getTimesCompleted()
The number of times the user has completed this badge.
|
int |
hashCode() |
java.lang.String |
toString() |
public BadgeProgressImpl(double progress, int timesCompleted, int completedConditionsCount, java.util.Map<java.lang.String,ConditionProgress> conditionsProgress, java.util.Date completedDate, java.util.Map<java.lang.String,RewardProgress> rewardProgress)
public java.util.Map<java.lang.String,RewardProgress> getRewardProgress()
BadgeProgress
getRewardProgress
in interface BadgeProgress
public double getProgress()
BadgeProgress
getProgress
in interface BadgeProgress
public int getCompletedConditionsCount()
BadgeProgress
getCompletedConditionsCount
in interface BadgeProgress
public java.util.Map<java.lang.String,ConditionProgress> getConditionsProgress()
BadgeProgress
getConditionsProgress
in interface BadgeProgress
Map
between a condition ID and its progress.public int getTimesCompleted()
BadgeProgress
0
, then the user did not completed the badge1
, then the user completed the badge exactly once1
, this is repeatable badge, and the user had completed it multiple timesgetTimesCompleted
in interface BadgeProgress
public java.util.Date getCompletedDate()
BadgeProgress
getCompletedDate
in interface BadgeProgress
null
, depending
on the source of the information. Specifically, information that is derived from a Create Action
Response, might not contain the completion date for a completed badge. To check if a badge was
completed or not see BadgeProgress.getTimesCompleted()
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object