com.skype
Class User

java.lang.Object
  extended by com.skype.User
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
Friend

public class User
extends Object

The User class contains the skype user's information.

For example, you can show the full name of the 'echo123' user by this code:

System.out.println(new User("echo123").getFullName());

See Also:
Serialized Form

Nested Class Summary
static class User.BuddyStatus
          The BuddyStatus enum contains the buddy status of the skype user.
static class User.Sex
          The Sex enum contains the sex constants of the skype user.
static class User.Status
          The Status enum contains the online status constants of the skype user.
 
Field Summary
static String MOOD_TEXT_PROPERTY
          Identifies the mood message property.
static String STATUS_PROPERTY
          Identifies the status property.
 
Method Summary
 void addPropertyChangeListener(PropertyChangeListener listener)
          Adds a PropertyChangeListener to this user.
 void askForAuthorization(String messageForAuthorization)
           
 Call call()
          Start a call to this User.
 boolean canLeaveVoiceMail()
          Indicates whether the current user can leave voice mails to this user.
 Chat chat()
          Start a chat to this User.
 boolean equals(Object compared)
          Overridden to compare User obejct based on ID.
 String getAbout()
          Deprecated. 
 Call[] getAllCalls()
          Search all calls to and from this User.
 ChatMessage[] getAllChatMessages()
          Search for all chatMessages to and from this User.
 BufferedImage getAvatar()
          Gets the avatar of this user.
 Date getBirthDay()
          Return the birthdate of this User.
 User.BuddyStatus getBuddyStatus()
          Returns the buddy status of this user.
 String getCity()
          Return the city this User is based in.
 String getCountry()
          Return the country the User is based.
 String getCountryByISOCode()
          Return the country by ISO code the User is based.
 Object getData(String name)
          Returns the user data to which this object maps to the specified by the name.
 String getDisplayName()
          Return the displayname of this User.
 String getFullName()
          Return full name of this User.
 String getHandle()
          Return the handle of this user
 String getHomePageAddress()
          Return the homepage URL of this User.
 String getHomePhone()
          Deprecated. 
 String getHomePhoneNumber()
          Return the home phone number that is in the User profile.
 String getId()
          Return ID of this User.
static User getInstance(String id)
          Returns the User object by the specified id.
 String getIntroduction()
          Returns introduction User has provided in his/her profile.
 String getLanguage()
          Return the native language of this User.
 String getLanguageByISOCode()
          Return the native language by ISO code of this User.
 Date getLastOnlineTime()
          Return last online time (UNIX timestamp).
 String getLauguage()
          Deprecated. 
 String getMobilePhone()
          Deprecated. 
 String getMobilePhoneNumber()
          Return the mobile phone number of this User.
 String getMoodMessage()
          Return the mood message of this user.
 String getOfficePhone()
          Deprecated. 
 String getOfficePhoneNumber()
          Return the office phone number that is in the User profile.
 User.Status getOnlineStatus()
          Deprecated. 
 String getProvince()
          Return the province the user is based.
 User.Sex getSex()
          Return the sex of this User.
 String getSpeedDial()
          Gets the speed dial of this user.
 void getSpeedDial(String newValue)
          Sets the speed dial of this user.
 User.Status getStatus()
          Return the online status of this User.
 int getTimeZone()
          Gets the time zone of the current user.
 int hashCode()
          Overridden to provide ID as hashcode.
 boolean isAuthorized()
          Check if this User is authorized in your contactlist.
 boolean isBlocked()
          Check if this User is blocked in your contactlist.
 boolean isForwardingCalls()
          Indicates whether the current user is forwarding calls.
 boolean isVideoCapable()
          Check if this User has a Skype client that can do video chats.
 void removePropertyChangeListener(PropertyChangeListener listener)
          Removes the PropertyChangeListener from this user.
 ChatMessage send(String message)
          Send this User a chatMessage.
 void setAuthorized(boolean on)
          Set this user being authorized, or not in your contactlist.
 void setBlocked(boolean on)
          Set this user being blocked, or not in your contactlist.
 void setBuddy(String msg)
           
 void setData(String name, Object userData)
          Associates the specified user data with the specified name in this object.
 void setDisplayName(String newValue)
          Set a displayname for this User.
 String toString()
          Provide ID as string representation.
 VoiceMail voiceMail()
          Leave a voicemail for this User.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

STATUS_PROPERTY

public static final String STATUS_PROPERTY
Identifies the status property.

See Also:
Constant Field Values

MOOD_TEXT_PROPERTY

public static final String MOOD_TEXT_PROPERTY
Identifies the mood message property.

See Also:
Constant Field Values
Method Detail

getInstance

public static User getInstance(String id)
Returns the User object by the specified id.

Parameters:
id - whose associated User object is to be returned.
Returns:
User object with ID == id.

hashCode

public final int hashCode()
Overridden to provide ID as hashcode.

Overrides:
hashCode in class Object
Returns:
ID.

equals

public final boolean equals(Object compared)
Overridden to compare User obejct based on ID.

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

toString

public final String toString()
Provide ID as string representation.

Overrides:
toString in class Object
Returns:
ID.

getId

public final String getId()
Return ID of this User.

Returns:
ID.

getFullName

public final String getFullName()
                         throws SkypeException
Return full name of this User.

Returns:
String with fullname.
Throws:
SkypeException - when connection to Skype client has gone bad.

getHandle

public final String getHandle()
                       throws SkypeException
Return the handle of this user

Returns:
String with handle.
Throws:
SkypeException - when connection to Skype client has gone bad.

getBirthDay

public final Date getBirthDay()
                       throws SkypeException
Return the birthdate of this User.

Returns:
Date of birthday.
Throws:
SkypeException - when connection to Skype client has gone bad.

getSex

public final User.Sex getSex()
                      throws SkypeException
Return the sex of this User.

Returns:
Sex of this User.
Throws:
SkypeException - when connection to Skype client has gone bad.

getOnlineStatus

@Deprecated
public final User.Status getOnlineStatus()
                                  throws SkypeException
Deprecated. 

Return the online status of this User.

Returns:
Status of this User.
Throws:
SkypeException - when connection to Skype client has gone bad.

getStatus

public final User.Status getStatus()
                            throws SkypeException
Return the online status of this User.

Returns:
Status of this User.
Throws:
SkypeException - when connection to Skype client has gone bad.

getLastOnlineTime

public Date getLastOnlineTime()
                       throws SkypeException
Return last online time (UNIX timestamp).

Returns:
Time of last online.
Throws:
SkypeException - when connection has gone bad.

getLauguage

@Deprecated
public final String getLauguage()
                         throws SkypeException
Deprecated. 

Return the native language of this User.

Returns:
String with native language.
Throws:
SkypeException - when connection to Skype client has gone bad.

getLanguage

public final String getLanguage()
                         throws SkypeException
Return the native language of this User.

Returns:
String with native language.
Throws:
SkypeException - when connection to Skype client has gone bad.

getLanguageByISOCode

public final String getLanguageByISOCode()
                                  throws SkypeException
Return the native language by ISO code of this User.

Returns:
String with native language.
Throws:
SkypeException - when connection to Skype client has gone bad.

getCountry

public final String getCountry()
                        throws SkypeException
Return the country the User is based.

Returns:
String with country.
Throws:
SkypeException - when connection to Skype client has gone bad.

getCountryByISOCode

public final String getCountryByISOCode()
                                 throws SkypeException
Return the country by ISO code the User is based.

Returns:
String with country.
Throws:
SkypeException - when connection to Skype client has gone bad.

getProvince

public final String getProvince()
                         throws SkypeException
Return the province the user is based.

Returns:
String with the province the user is based.
Throws:
SkypeException - when connection to Skype client has gone bad.

getCity

public final String getCity()
                     throws SkypeException
Return the city this User is based in.

Returns:
String with the city name the User is based in.
Throws:
SkypeException - when connection to Skype client has gone bad.

getHomePhone

@Deprecated
public final String getHomePhone()
                          throws SkypeException
Deprecated. 

Return the home phone number that is in the User profile.

Returns:
String with Home phone number.
Throws:
SkypeException - when connection to Skype client has gone bad.

getHomePhoneNumber

public final String getHomePhoneNumber()
                                throws SkypeException
Return the home phone number that is in the User profile.

Returns:
String with Home phone number.
Throws:
SkypeException - when connection to Skype client has gone bad.

getOfficePhone

@Deprecated
public final String getOfficePhone()
                            throws SkypeException
Deprecated. 

Return the office phone number that is in the User profile.

Returns:
String with office phone number.
Throws:
SkypeException - when connection to Skype client has gone bad.

getOfficePhoneNumber

public final String getOfficePhoneNumber()
                                  throws SkypeException
Return the office phone number that is in the User profile.

Returns:
String with office phone number.
Throws:
SkypeException - when connection to Skype client has gone bad.

getMobilePhone

@Deprecated
public final String getMobilePhone()
                            throws SkypeException
Deprecated. 

Return the mobile phone number of this User.

Returns:
String with mobile phone number.
Throws:
SkypeException - when connection to Skype client has gone bad.

getMobilePhoneNumber

public final String getMobilePhoneNumber()
                                  throws SkypeException
Return the mobile phone number of this User.

Returns:
String with mobile phone number.
Throws:
SkypeException - when connection to Skype client has gone bad.

getHomePageAddress

public final String getHomePageAddress()
                                throws SkypeException
Return the homepage URL of this User.

Returns:
String with URL of homepage.
Throws:
SkypeException - when connection to Skype client has gone bad.

getAbout

@Deprecated
public final String getAbout()
                      throws SkypeException
Deprecated. 

Return extra information User has provided in his/her profile.

Returns:
STring with extra info.
Throws:
SkypeException - when connection to Skype client has gone bad.

getIntroduction

public final String getIntroduction()
                             throws SkypeException
Returns introduction User has provided in his/her profile.

Returns:
STring with extra info.
Throws:
SkypeException - when connection to Skype client has gone bad.

getMoodMessage

public String getMoodMessage()
                      throws SkypeException
Return the mood message of this user.

Returns:
the mood message of this user.
Throws:
SkypeException - when connection to Skype client has gone bad.

getSpeedDial

public String getSpeedDial()
                    throws SkypeException
Gets the speed dial of this user.

Returns:
the speed dial of this user.
Throws:
SkypeException - when the connection has gone bad or an ERROR message is received.
See Also:
#setSpeedDial(String)

getSpeedDial

public void getSpeedDial(String newValue)
                  throws SkypeException
Sets the speed dial of this user.

Parameters:
newValue - the speed dial of this user.
Throws:
SkypeException - when the connection has gone bad or an ERROR message is received.
See Also:
getSpeedDial()

getTimeZone

public int getTimeZone()
                throws SkypeException
Gets the time zone of the current user.

Returns:
the time zone of the current user.
Throws:
SkypeException - when the connection has gone bad or an ERROR message is received.
See Also:
#setTimeZone(int)

getDisplayName

public final String getDisplayName()
                            throws SkypeException
Return the displayname of this User.

Returns:
String with displayname.
Throws:
SkypeException - when connection to Skype client has gone bad.

isVideoCapable

public final boolean isVideoCapable()
                             throws SkypeException
Check if this User has a Skype client that can do video chats.

Returns:
true if User can do videochats.
Throws:
SkypeException - when connection to Skype client has gone bad.

getBuddyStatus

public final User.BuddyStatus getBuddyStatus()
                                      throws SkypeException
Returns the buddy status of this user.

Returns:
Buddy status of this user
Throws:
SkypeException - when connection to Skype client has gone bad.

askForAuthorization

public final void askForAuthorization(String messageForAuthorization)
                               throws SkypeException
Throws:
SkypeException

isAuthorized

public final boolean isAuthorized()
                           throws SkypeException
Check if this User is authorized in your contactlist.

Returns:
true if User is authorized.
Throws:
SkypeException - when connection to Skype client has gone bad.

setAuthorized

public final void setAuthorized(boolean on)
                         throws SkypeException
Set this user being authorized, or not in your contactlist.

Parameters:
on - true if user will be authorized.
Throws:
SkypeException - when connection to Skype client has gone bad.

isBlocked

public final boolean isBlocked()
                        throws SkypeException
Check if this User is blocked in your contactlist.

Returns:
true if User is blocked.
Throws:
SkypeException - when connection to Skype client has gone bad.

canLeaveVoiceMail

public final boolean canLeaveVoiceMail()
                                throws SkypeException
Indicates whether the current user can leave voice mails to this user.

Returns:
true if the current user can leave voice mails; false otherwise.
Throws:
SkypeException - when the connection has gone bad or an ERROR message is received.

isForwardingCalls

public final boolean isForwardingCalls()
                                throws SkypeException
Indicates whether the current user is forwarding calls.

Returns:
true if the current user is forwarding calls; false otherwise.
Throws:
SkypeException - when the connection has gone bad or an ERROR message is received.

setBlocked

public final void setBlocked(boolean on)
                      throws SkypeException
Set this user being blocked, or not in your contactlist.

Parameters:
on - true if user will be blocked.
Throws:
SkypeException - when connection to Skype client has gone bad.

getAvatar

public BufferedImage getAvatar()
                        throws SkypeException
Gets the avatar of this user.

Returns:
the avatar image of this user.
Throws:
SkypeException - when the connection has gone bad or an ERROR message is received.
Since:
Protocol 7

call

public final Call call()
                throws SkypeException
Start a call to this User.

Returns:
new Call object.
Throws:
SkypeException - when connection to Skype client has gone bad.

chat

public final Chat chat()
                throws SkypeException
Start a chat to this User.

Returns:
new Chat object.
Throws:
SkypeException - when connection to Skype client has gone bad.

send

public final ChatMessage send(String message)
                       throws SkypeException
Send this User a chatMessage.

Parameters:
message - The message to send.
Returns:
the new chatMessage object.
Throws:
SkypeException - when connection to Skype client has gone bad.

voiceMail

public final VoiceMail voiceMail()
                          throws SkypeException
Leave a voicemail for this User.

Returns:
new VoiceMail object.
Throws:
SkypeException - when connection to Skype client has gone bad.

setDisplayName

public final void setDisplayName(String newValue)
                          throws SkypeException
Set a displayname for this User.

Parameters:
newValue - the new name to set.
Throws:
SkypeException - when connection to Skype client has gone bad.

setBuddy

public final void setBuddy(String msg)
                    throws SkypeException
Throws:
SkypeException

getAllChatMessages

public final ChatMessage[] getAllChatMessages()
                                       throws SkypeException
Search for all chatMessages to and from this User.

Returns:
array of Chatmessages found.
Throws:
SkypeException - when connection to Skype client has gone bad.

getAllCalls

public final Call[] getAllCalls()
                         throws SkypeException
Search all calls to and from this User.

Returns:
an array of found calls.
Throws:
SkypeException - when connection to Skype client has gone bad.

addPropertyChangeListener

public final void addPropertyChangeListener(PropertyChangeListener listener)
                                     throws SkypeException
Adds a PropertyChangeListener to this user.

The listener is registered for all bound properties of this user, including the following:

If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the PropertyChangeListener to be added
Throws:
SkypeException
See Also:
removePropertyChangeListener(PropertyChangeListener)

removePropertyChangeListener

public final void removePropertyChangeListener(PropertyChangeListener listener)
Removes the PropertyChangeListener from this user.

If listener is null, no exception is thrown and no action is performed.

Parameters:
listener - the PropertyChangeListener to be removed
See Also:
addPropertyChangeListener(PropertyChangeListener)

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.