Class Contact
Contact
class represents a contact of the current user.
A Contact can be another user, a radio gateway, a group channel or a dynamic channel (see ContactType
).-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()
Returns the display name for theContact
.Returns the full name of theContact
.boolean
getMuted()
Returns whether theContact
is muted or not.getName()
Returns the identifying name of theContact
.boolean
Returns whether the channel has the no disconnect setting enabled or not.Returns theContactStatus
for theContact
.Returns the custom status message for theContact
.getTitle()
Returns the title for theContact
.getType()
Returns theContactType
for theContact
.int
Returns the number of online users in the channel.int
Returns the number of total users in the channel.boolean
isValid()
Check if the object is empty.void
reset()
Resets theContact
instance back to the default values.
-
Constructor Details
-
Contact
public Contact()
-
-
Method Details
-
reset
public void reset()Resets the
Contact
instance back to the default values.This method only resets the values for this copied instance of the
Contact
. -
clone
-
isValid
public boolean isValid()Check if the object is empty.- Returns:
- true if the object represents a valid contact.
-
getName
Returns the identifying name of the
Contact
.For
and @link ContactType#GROUP
the value is the channel name. ForContactType.USER
andContactType.GATEWAY
the value is the username. ForContactType.CONVERSATION
the value is a unique conversation ID.- Returns:
- Name of the
Contact
.
-
getFullName
Returns the full name of theContact
.- Returns:
- Nullable; Full name of the
Contact
.
-
getDisplayName
Returns the display name for the
Contact
.Use this function if you need to show the contact on the screen as it uses the best available data to build the human-readable name.
- Returns:
- Nullable; Display Name for the
Contact
.
-
getType
Returns theContactType
for theContact
.- Returns:
ContactType
for theContact
.
-
getStatus
Returns theContactStatus
for theContact
.- Returns:
ContactStatus
for theContact
.
-
getStatusMessage
Returns the custom status message for theContact
.- Returns:
- Nullable; The status message for the
Contact
.
-
getUsersCount
public int getUsersCount()Returns the number of online users in the channel.
For
ContactType.CHANNEL
.ContactType.GROUP
and andContactType.CONVERSATION
this value is the number of users online in the channel or group, respectively. ForContactType.USER
andContactType.GATEWAY
this value is not defined (0
is returned).- Returns:
- number of online users under the
Contact
for theContactType
.
-
getUsersTotal
public int getUsersTotal()Returns the number of total users in the channel.
For
ContactType.GROUP
andContactType.CONVERSATION
this value is the number of total users in the channel or group, respectively. ForContactType.USER
,ContactType.GATEWAY
andContactType.CHANNEL
this value is not defined (0
is returned).- Returns:
- number of total users under the
Contact
for theContactType
.
-
getTitle
Returns the title for the
Contact
.For
ContactType.CHANNEL
andContactType.GROUP
this value is not defined (null
is returned)- Returns:
- Nullable; The title for the
Contact
.
-
getMuted
public boolean getMuted()Returns whether theContact
is muted or not.- Returns:
- boolean indicating if the
Contact
is muted.
-
getNoDisconnect
public boolean getNoDisconnect()Returns whether the channel has the no disconnect setting enabled or not.For
ContactType.USER
,ContactType.GATEWAY
andContactType.CONVERSATION
this value is not defined (false
is returned).- Returns:
- boolean indicating if the
Contact
has the no disconnect setting enabled.
-