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 class
RowItem.Type
Available types that this row item can represent.
-
Constructor Summary
Constructors Modifier Constructor and Description protected
RowItem()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description 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
int
compareTo(RowItem rowItem)
Compares twoRowItem
items by their time valuesboolean
equals(java.lang.Object o)
java.lang.String
getDisplayName()
java.lang.String
getId()
java.lang.String
getParticipantId()
java.lang.Long
getTimestamp()
RowItem.Type
getType()
int
hashCode()
void
setDisplayName(java.lang.String displayName)
void
setId(java.lang.String id)
void
setParticipantId(java.lang.String participantId)
void
setTimestamp(java.lang.Long timestamp)
protected void
setType(RowItem.Type type)
java.lang.String
toString()
void
update(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:
canBeCastTo
in 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:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
compareTo
public int compareTo(RowItem rowItem) throws java.lang.NullPointerException
Compares twoRowItem
items by their time values- Specified by:
compareTo
in 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:
toString
in classjava.lang.Object
-
-