Class RowItem<T extends RowItem>
- java.lang.Object
-
- com.zopim.android.sdk.model.items.RowItem<T>
-
- Direct Known Subclasses:
- AgentItem, ChatEvent, ChatMemberEvent, ChatRating, VisitorItem
public abstract class RowItem<T extends RowItem> extends java.lang.Object implements java.lang.Comparable<RowItem>, Updatable<T>
This is an abstract model class for agent events that will be created byLivechatChatLogPath.It provides the following updates:
- ID of the message
- Display name of the participant in the chat
- Nick or an ID of the participant in the chat
- Timestamp of the chat event
You can subscribe to chat item broadcast via
DataSource.addChatLogObserver(ChatLogObserver)usingChatItemsObserver
-
-
Nested Class Summary
Nested Classes Modifier and Type Class and Description static classRowItem.TypeAvailable types that this row item can represent.
-
Constructor Summary
Constructors Modifier Constructor and Description protectedRowItem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancanBeCastTo(java.lang.Object item)Ensuring that the item type is the same for both so we don't try casting to an incorrect type ofRowItemintcompareTo(RowItem rowItem)Compares twoRowItemitems by their time valuesbooleanequals(java.lang.Object o)java.lang.StringgetDisplayName()java.lang.StringgetId()java.lang.StringgetParticipantId()java.lang.LonggetTimestamp()RowItem.TypegetType()inthashCode()voidsetDisplayName(java.lang.String displayName)voidsetId(java.lang.String id)voidsetParticipantId(java.lang.String participantId)voidsetTimestamp(java.lang.Long timestamp)protected voidsetType(RowItem.Type type)java.lang.StringtoString()voidupdate(T item)Updates this item with item passed as parameter.
-
-
-
Method Detail
-
update
public void update(T item)
Updates this item with item passed as parameter.This will update this instance with the parameter passed as value.
-
canBeCastTo
public final boolean canBeCastTo(java.lang.Object item)
Ensuring that the item type is the same for both so we don't try casting to an incorrect type ofRowItem- Specified by:
canBeCastToin interfaceUpdatable<T extends RowItem>- Parameters:
item- to update from- Returns:
- true if casting can succeed, false otherwise
-
getId
public java.lang.String getId()
-
setId
public void setId(java.lang.String id)
-
getType
public RowItem.Type getType()
-
setType
protected void setType(RowItem.Type type)
-
getDisplayName
public java.lang.String getDisplayName()
-
setDisplayName
public void setDisplayName(java.lang.String displayName)
-
getParticipantId
public java.lang.String getParticipantId()
-
setParticipantId
public void setParticipantId(java.lang.String participantId)
-
getTimestamp
public java.lang.Long getTimestamp()
-
setTimestamp
public void setTimestamp(java.lang.Long timestamp)
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
compareTo
public int compareTo(RowItem rowItem) throws java.lang.NullPointerException
Compares twoRowItemitems by their time values- Specified by:
compareToin interfacejava.lang.Comparable<RowItem>- Parameters:
rowItem- to compare to- Returns:
- -1,0,1 if this item is less, equals or grater then specified item
- Throws:
java.lang.NullPointerException- if comparison was not possible
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-