public final class Identity extends Object implements Comparable<Identity>
This class is immutable.3. Discovering Information About a Jabber Entity
In disco, an entity's identity is broken down into its category (server, client, gateway, directory, etc.) and its particular type within that category (IM server, phone vs. handheld client, MSN gateway vs. AIM gateway, user directory vs. chatroom directory, etc.). This information helps requesting entities to determine the group or "bucket" of services into which the entity is most appropriately placed (e.g., perhaps the entity is shown in a GUI with an appropriate icon). An entity MAY have multiple identities. When multiple identity elements are provided, the name attributes for each identity element SHOULD have the same value.
| Constructor and Description |
|---|
Identity(String category,
String type)
Creates an identity with a category and type.
|
Identity(String category,
String type,
String name)
Creates an identity with a category, type and name.
|
Identity(String category,
String type,
String name,
String language)
Creates an identity with a category, type, name and language.
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(Identity o)
Implements a natural ordering of an identity, as suggested and required by XEP-0115: Entity Capabilities.
|
boolean |
equals(Object o)
An identity is considered equal, if category, type and language are equal, because there cannot be two identities with the same category, type and language, but with different names.
|
String |
getCategory()
Gets the category, e.g. server, client, gateway, directory, etc.
|
String |
getLanguage()
The optional language to localize the name.
|
String |
getName()
Gets the identity's name.
|
String |
getType()
Gets the type within the category, e.g.
|
int |
hashCode() |
String |
toString() |
public Identity(String category, String type)
category - The category.type - The type.public Identity(String category, String type, String name)
category - The category.type - The type.name - The name.public final String getCategory()
public final String getType()
public final String getName()
public final String getLanguage()
public final boolean equals(Object o)
public final int compareTo(Identity o)
compareTo in interface Comparable<Identity>o - The other identity.Copyright © 2014–2015 XMPP.rocks. All rights reserved.