Chat Android SDK  7.0.1
com.twilio.chat.Attributes Class Reference

Attributes representation, can be set to Channel, User, Member or Message. More...

Public Member Functions

 Attributes ()
 Create NULL attributes.
 
 Attributes (@NonNull JSONObject object)
 Initialize attributes with a JSONObject.
 
 Attributes (@NonNull JSONArray array)
 Initialize attributes with a JSONArray.
 
 Attributes (@NonNull String string)
 Initialize attributes with a String.
 
 Attributes (@NonNull Number number)
 Initialize attributes with a Number.
 
 Attributes (boolean value)
 Initialize attributes with a boolean value.
 
Type getType ()
 
JSONObject getJSONObject ()
 
JSONArray getJSONArray ()
 
String getString ()
 
Number getNumber ()
 
Boolean getBoolean ()
 

Static Public Attributes

static final Attributes DEFAULT = new Attributes(new JSONObject())
 Default attributes value. More...
 

Detailed Description

Attributes representation, can be set to Channel, User, Member or Message.

Member Function Documentation

Boolean com.twilio.chat.Attributes.getBoolean ( )
Returns
Boolean stored in attributes if getType of attributes is Type#BOOLEAN, otherwise returns null.
JSONArray com.twilio.chat.Attributes.getJSONArray ( )
Returns
JSONArray stored in attributes if getType of attributes is Type#ARRAY, otherwise returns null.
JSONObject com.twilio.chat.Attributes.getJSONObject ( )
Returns
JSONObject stored in attributes if getType of attributes is Type#OBJECT, otherwise returns null.
Number com.twilio.chat.Attributes.getNumber ( )
Returns
Number stored in attributes if getType of attributes is Type#NUMBER, otherwise returns null.
String com.twilio.chat.Attributes.getString ( )
Returns
String stored in attributes if getType of attributes is Type#STRING, otherwise returns null.
Type com.twilio.chat.Attributes.getType ( )
Returns
Type of attributes

Member Data Documentation

final Attributes com.twilio.chat.Attributes.DEFAULT = new Attributes(new JSONObject())
static

Default attributes value.