public class Card extends java.util.Observable implements IPutIntoJson<org.json.JSONObject>
| Constructor and Description |
|---|
Card(org.json.JSONObject object,
CardKey.Provider cardKeyProvider) |
Card(org.json.JSONObject object,
CardKey.Provider cardKeysProvider,
IBrazeManager manager,
ICardStorageProvider<?> cardStorageProvider,
ICardAnalyticsProvider cardAnalyticsProvider)
Creates a card.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object otherCard)
Compares against another
Card instance. |
org.json.JSONObject |
forJsonPut()
The
JSONObject representation of this card. |
CardType |
getCardType()
Returns a
CardType representing the type of this card. |
java.util.EnumSet<CardCategory> |
getCategories()
Returns the categories for this Feed card.
|
long |
getCreated() |
long |
getExpiresAt()
Gets the expiration date of the card.
|
java.util.Map<java.lang.String,java.lang.String> |
getExtras() |
java.lang.String |
getId() |
boolean |
getIsDismissibleByUser() |
boolean |
getIsPinned() |
boolean |
getOpenUriInWebView() |
long |
getUpdated() |
java.lang.String |
getUrl() |
boolean |
getViewed() |
int |
hashCode() |
boolean |
isClicked()
Gets the clicked state of this card.
|
boolean |
isContentCard() |
boolean |
isControl()
Returns whether this card is a control card.
|
boolean |
isDismissed() |
boolean |
isEqualToCard(Card card)
Deprecated.
Please use
equals(Object) instead. |
boolean |
isExpired() |
boolean |
isInCategorySet(java.util.EnumSet<CardCategory> categories) |
boolean |
isIndicatorHighlighted()
Gets whether the visual indicator at the bottom of the card is highlighted.
|
boolean |
isRead()
Deprecated.
|
boolean |
isRemoved() |
boolean |
isTest() |
boolean |
logClick()
Reports this card was clicked.
|
boolean |
logImpression()
Reports that this card was displayed to the user.
|
void |
setIndicatorHighlighted(boolean enabled)
Sets the visual indicator at the bottom of the card is highlighted.
|
void |
setIsDismissed(boolean isDismissed)
Sets a card as dismissed.
|
void |
setIsDismissibleByUser(boolean isDismissible)
Sets whether this card can be dismissed by the user.
|
void |
setIsPinned(boolean isPinned)
Sets this card as pinned in the default UI.
|
void |
setIsRead(boolean read)
Deprecated.
|
void |
setIsTest(boolean isTest) |
void |
setViewed(boolean viewed)
This should be set to true when a card has it's impression logged.
|
java.lang.String |
toString() |
public Card(org.json.JSONObject object,
CardKey.Provider cardKeyProvider)
throws org.json.JSONException
org.json.JSONExceptionpublic Card(org.json.JSONObject object,
CardKey.Provider cardKeysProvider,
IBrazeManager manager,
ICardStorageProvider<?> cardStorageProvider,
ICardAnalyticsProvider cardAnalyticsProvider)
throws org.json.JSONException
object - JSON representation of the cardcardKeysProvider - The CardKey.Provider responsible for providing the appropriate key for a field.manager - Allows the card to report clicks internallycardStorageProvider - Allows the card to persist its viewed/unviewed stateorg.json.JSONException - When the provided JSON object is malformedpublic boolean logImpression()
public boolean logClick()
public boolean isClicked()
@Deprecated public boolean isRead()
isIndicatorHighlighted()public boolean isIndicatorHighlighted()
@Deprecated public void setIsRead(boolean read)
setIndicatorHighlighted(boolean)public void setIndicatorHighlighted(boolean enabled)
public boolean isDismissed()
public void setIsDismissed(boolean isDismissed)
public boolean getViewed()
public void setViewed(boolean viewed)
@Deprecated public boolean isEqualToCard(Card card)
equals(Object) instead.public java.lang.String getId()
public java.util.Map<java.lang.String,java.lang.String> getExtras()
public java.lang.String getUrl()
public boolean getIsPinned()
public boolean getOpenUriInWebView()
public long getCreated()
public long getUpdated()
public boolean isRemoved()
public boolean getIsDismissibleByUser()
public void setIsDismissibleByUser(boolean isDismissible)
isDismissible - The new value for whether this card can be dismissed by the user.public void setIsPinned(boolean isPinned)
isPinned - The new pinned status.public long getExpiresAt()
public boolean isExpired()
public java.util.EnumSet<CardCategory> getCategories()
public boolean isInCategorySet(java.util.EnumSet<CardCategory> categories)
categories - public CardType getCardType()
CardType representing the type of this card.CardType.DEFAULT if the type is not known.public boolean isControl()
public boolean isContentCard()
Card originally represented a Content Card.public void setIsTest(boolean isTest)
public boolean isTest()
public org.json.JSONObject forJsonPut()
JSONObject representation of this card.forJsonPut in interface IPutIntoJson<org.json.JSONObject>public java.lang.String toString()
toString in class java.lang.Objectpublic boolean equals(java.lang.Object otherCard)
Card instance.equals in class java.lang.ObjectgetUpdated() time, and unique getId().public int hashCode()
hashCode in class java.lang.Object