public class User extends Object
PresenceChannel.| Constructor and Description |
|---|
User(String id,
String jsonData)
Create a new user.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object other) |
String |
getId()
A unique identifier for the user within a Pusher application.
|
String |
getInfo()
Custom additional information about a user as a String encoding a JSON
hash
|
<V> V |
getInfo(Class<V> clazz)
Custom additional information about a user decoded as a new instance of
the provided POJO bean type
|
int |
hashCode() |
String |
toString() |
public String getId()
public String getInfo()
public <V> V getInfo(Class<V> clazz)
Custom additional information about a user decoded as a new instance of the provided POJO bean type
e.g. if getInfo() returns
{"name":"Mr User","number":9} then you might implement as
follows:
public class UserInfo {
private String name;
private Integer number;
public String getName() { return name; }
public void setName(String name) { this.name = name; }
public Integer getNumber() { return number; }
public void setNumber(Integer number) { this.number = number; }
}
UserInfo info = user.getInfo(UserInfo.class);
info.getName() // returns "Mr User"
info.getNumber() // returns 9
V - The class of the infoclazz - the class into which the user info JSON representation should
be parsed.Copyright © 2016 Pusher. All rights reserved.