com.skype
Class ChatMessage

java.lang.Object
  extended by com.skype.ChatMessage
All Implemented Interfaces:
Serializable

public final class ChatMessage
extends Object

This class implements Skype CHATMESSAGE object.

Author:
Koji Hisano
See Also:
Protocol 3. Supersedes the MESSAGE object., Serialized Form

Nested Class Summary
static class ChatMessage.LeaveReason
          Enumeration for LeaveReason.
static class ChatMessage.Status
          Enumeration for STATUS of CHATMESSAGE.
static class ChatMessage.Type
          Enumeration for type.
 
Method Summary
 boolean equals(Object compared)
          Compare two object to check equalness.
 User[] getAllUsers()
          Return all users added to CHAT.
 Chat getChat()
          Get the parent CHAT object for this CHATMESSAGE.
 String getContent()
          Get the content of this CHATMESSAGE.
 Object getData(String name)
          Returns the user data to which this object maps to the specified by the name.
 String getId()
          Return CHATMESSAGE ID.
 ChatMessage.LeaveReason getLeaveReason()
          Get the leave reason.
 User getSender()
          Return the User who sended this CHATMESSAGE.
 String getSenderDisplayName()
          Return the displayname of the sender of this CHATMESSAGE.
 String getSenderId()
          Return the handle of the user who has sent this CHATMESSAGE.
 ChatMessage.Status getStatus()
          Get the status of this CHATMESSAGE.
 Date getTime()
          Return time when message was sent (UNIX timestamp).
 ChatMessage.Type getType()
          Get the type of this CHATMESSAGE.
 int hashCode()
          Returns the hashcode for this object.
 boolean isEditable()
          Indicates if the chat message is editable.
 void setContent(String content)
          Sets the content of the chat message to the specified string.
 void setData(String name, Object userData)
          Associates the specified user data with the specified name in this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

hashCode

public int hashCode()
Returns the hashcode for this object. In this case it's ID.

Overrides:
hashCode in class Object
Returns:
ID.

equals

public boolean equals(Object compared)
Compare two object to check equalness.

Overrides:
equals in class Object
Parameters:
compared - the object to check against.
Returns:
true if object ID's are equal.

getId

public String getId()
Return CHATMESSAGE ID.

Returns:
ID of this chatmessage.

getTime

public Date getTime()
             throws SkypeException
Return time when message was sent (UNIX timestamp).

Returns:
Date of this chatmessage.
Throws:
SkypeException - when connection has gone bad.

getSender

public User getSender()
               throws SkypeException
Return the User who sended this CHATMESSAGE.

Returns:
User object of sender.
Throws:
SkypeException - when connection has gone bad.

getSenderId

public String getSenderId()
                   throws SkypeException
Return the handle of the user who has sent this CHATMESSAGE.

Returns:
a String with the handle.
Throws:
SkypeException - when the connection has gone bad.

getSenderDisplayName

public String getSenderDisplayName()
                            throws SkypeException
Return the displayname of the sender of this CHATMESSAGE.

Returns:
a String with the displayname of the sender.
Throws:
SkypeException - when the connection has gone bad.

getType

public ChatMessage.Type getType()
                         throws SkypeException
Get the type of this CHATMESSAGE.

Returns:
Type of this chatmessage.
Throws:
SkypeException - when the connection has gone bad.
See Also:
ChatMessage.Type

getStatus

public ChatMessage.Status getStatus()
                             throws SkypeException
Get the status of this CHATMESSAGE.

Returns:
Status of this chatmessage.
Throws:
SkypeException - when the connection has gone bad.
See Also:
ChatMessage.Status

getLeaveReason

public ChatMessage.LeaveReason getLeaveReason()
                                       throws SkypeException
Get the leave reason.

Returns:
get the leave reason.
Throws:
SkypeException - when the connection has gone bad.
See Also:
ChatMessage.LeaveReason

getContent

public String getContent()
                  throws SkypeException
Get the content of this CHATMESSAGE.

Returns:
the content of this chatmessage.
Throws:
SkypeException - when the connection has gone bad.

setContent

public void setContent(String content)
                throws SkypeException
Sets the content of the chat message to the specified string.

Parameters:
name - the string that is to be this chat message's content
Throws:
SkypeException - when the connection has gone bad.
Since:
Protocol 7 (API version 3.0)
See Also:
getContent()

isEditable

public boolean isEditable()
                   throws SkypeException
Indicates if the chat message is editable.

Returns:
true if the chat message is editable
Throws:
SkypeException - when the connection has gone bad.

getChat

public Chat getChat()
             throws SkypeException
Get the parent CHAT object for this CHATMESSAGE.

Returns:
parent CHAT object.
Throws:
SkypeException - when the connection has gone bad.
See Also:
Chat

getAllUsers

public User[] getAllUsers()
                   throws SkypeException
Return all users added to CHAT.

Returns:
Array of users.
Throws:
SkypeException - when connection has gone bad.

getData

public final Object getData(String name)
Returns the user data to which this object maps to the specified by the name. Returns null if this object contains no mapping for the name.

Parameters:
name - name whose associated user data is to be returned.
Returns:
the user data to which this object maps the specified name, or null if this object contains no mapping for the name.
See Also:
Map.get(Object)

setData

public final void setData(String name,
                          Object userData)
Associates the specified user data with the specified name in this object.

Parameters:
name - name with which the specified user data is to be associated.
userData - user data to be associated with the specified name.
See Also:
Map.put(Object, Object)


Copyright © 2004-2011. All Rights Reserved.