Package com.cometchat.pro.models
Class Group
- java.lang.Object
-
- com.cometchat.pro.models.AppEntity
-
- com.cometchat.pro.models.Group
-
public class Group extends AppEntity
Created by adityagokula on 12/09/18.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringCOLUMN_CREATED_ATstatic java.lang.StringCOLUMN_DESCRIPTIONstatic java.lang.StringCOLUMN_GROUP_TYPEstatic java.lang.StringCOLUMN_GUIDstatic java.lang.StringCOLUMN_HAS_JOINEDstatic java.lang.StringCOLUMN_ICONstatic java.lang.StringCOLUMN_IDENTITYstatic java.lang.StringCOLUMN_METADATAstatic java.lang.StringCOLUMN_NAMEstatic java.lang.StringCOLUMN_OWNERstatic java.lang.StringCOLUMN_PASSWORDstatic java.lang.StringCOLUMN_UPDATED_ATstatic java.lang.StringTABLE_GROUPS
-
Constructor Summary
Constructors Constructor Description Group()Group(java.lang.String guid, java.lang.String name, java.lang.String groupType, java.lang.String password)Group(java.lang.String guid, java.lang.String name, java.lang.String groupType, java.lang.String password, java.lang.String icon, java.lang.String description)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)static GroupfromJson(java.lang.String json)static java.util.List<Group>fromJSONArray(java.lang.String response)longgetCreatedAt()Get timestamp of group creationjava.lang.StringgetDescription()Get description of the Groupjava.lang.StringgetGroupType()Get type of the group types of th group : GROUP_TYPE_PUBLIC GROUP_TYPE_PASSWORD GROUP_TYPE_PRIVATEjava.lang.StringgetGuid()Get unique identifier of the Groupjava.lang.StringgetIcon()Get URL of the iconlonggetJoinedAt()Get join at timestamp of logged in user in a particular groupintgetMembersCount()Get number of members that are a part of the groupJSONObjectgetMetadata()GetJSONObjectof data set by developerjava.lang.StringgetName()Get name of the groupjava.lang.StringgetOwner()GetUIDof the owner of the Groupjava.lang.StringgetPassword()Get password of the password protected groupjava.lang.StringgetScope()Get scope of logged in user in a particular groupjava.util.List<java.lang.String>getTags()Get the tags that are specified for the grouplonggetUpdatedAt()Get timestamp of group updateinthashCode()booleanisJoined()Get join information of logged in user in a particular groupvoidsetCreatedAt(long createdAt)voidsetDescription(java.lang.String description)voidsetGroupType(java.lang.String groupType)voidsetGuid(java.lang.String guid)voidsetHasJoined(boolean hasJoined)voidsetIcon(java.lang.String icon)voidsetJoinedAt(long joinedAt)voidsetMembersCount(int membersCount)voidsetMetadata(JSONObject metadata)voidsetName(java.lang.String name)voidsetOwner(java.lang.String owner)voidsetPassword(java.lang.String password)voidsetScope(java.lang.String scope)voidsetTags(java.util.List<java.lang.String> tags)voidsetUpdatedAt(long updatedAt)java.util.HashMap<java.lang.String,java.lang.String>toMap()java.lang.StringtoString()
-
-
-
Field Detail
-
TABLE_GROUPS
public static final java.lang.String TABLE_GROUPS
- See Also:
- Constant Field Values
-
COLUMN_GUID
public static final java.lang.String COLUMN_GUID
- See Also:
- Constant Field Values
-
COLUMN_NAME
public static final java.lang.String COLUMN_NAME
- See Also:
- Constant Field Values
-
COLUMN_GROUP_TYPE
public static final java.lang.String COLUMN_GROUP_TYPE
- See Also:
- Constant Field Values
-
COLUMN_PASSWORD
public static final java.lang.String COLUMN_PASSWORD
- See Also:
- Constant Field Values
-
COLUMN_ICON
public static final java.lang.String COLUMN_ICON
- See Also:
- Constant Field Values
-
COLUMN_DESCRIPTION
public static final java.lang.String COLUMN_DESCRIPTION
- See Also:
- Constant Field Values
-
COLUMN_OWNER
public static final java.lang.String COLUMN_OWNER
- See Also:
- Constant Field Values
-
COLUMN_METADATA
public static final java.lang.String COLUMN_METADATA
- See Also:
- Constant Field Values
-
COLUMN_CREATED_AT
public static final java.lang.String COLUMN_CREATED_AT
- See Also:
- Constant Field Values
-
COLUMN_UPDATED_AT
public static final java.lang.String COLUMN_UPDATED_AT
- See Also:
- Constant Field Values
-
COLUMN_HAS_JOINED
public static final java.lang.String COLUMN_HAS_JOINED
- See Also:
- Constant Field Values
-
COLUMN_IDENTITY
public static final java.lang.String COLUMN_IDENTITY
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
Group
public Group(java.lang.String guid, java.lang.String name, java.lang.String groupType, java.lang.String password)
-
Group
public Group(java.lang.String guid, java.lang.String name, java.lang.String groupType, java.lang.String password, java.lang.String icon, java.lang.String description)
-
Group
public Group()
-
-
Method Detail
-
getGuid
public java.lang.String getGuid()
Get unique identifier of the Group- Returns:
- GUID of the group
- Since:
- v1
-
setGuid
public void setGuid(java.lang.String guid)
-
getName
public java.lang.String getName()
Get name of the group- Returns:
- name of the Group
- Since:
- v1
-
setName
public void setName(java.lang.String name)
-
getIcon
public java.lang.String getIcon()
Get URL of the icon- Returns:
- URL of the icon
- Since:
- v1
-
setIcon
public void setIcon(java.lang.String icon)
-
getDescription
public java.lang.String getDescription()
Get description of the Group- Returns:
- description of the group
- Since:
- v1
-
setDescription
public void setDescription(java.lang.String description)
-
getOwner
public java.lang.String getOwner()
GetUIDof the owner of the Group- Returns:
- UID of the user
- Since:
- v1
-
setOwner
public void setOwner(java.lang.String owner)
-
getGroupType
public java.lang.String getGroupType()
Get type of the group types of th group :- GROUP_TYPE_PUBLIC
- GROUP_TYPE_PASSWORD
- GROUP_TYPE_PRIVATE
- Returns:
- type of the Group
- Since:
- v1
- See Also:
CometChatConstants.GroupTypes
-
setGroupType
public void setGroupType(java.lang.String groupType)
-
getPassword
public java.lang.String getPassword()
Get password of the password protected group- Returns:
- password of the group
- Since:
- v1
-
setPassword
public void setPassword(java.lang.String password)
-
getMetadata
public JSONObject getMetadata()
GetJSONObjectof data set by developer- Returns:
JSONObjectof custom data set by developer- Since:
- v1
-
setMetadata
public void setMetadata(JSONObject metadata)
-
getCreatedAt
public long getCreatedAt()
Get timestamp of group creation- Returns:
- creation timestamp
- Since:
- v1
-
setCreatedAt
public void setCreatedAt(long createdAt)
-
getUpdatedAt
public long getUpdatedAt()
Get timestamp of group update- Returns:
- updated timestamp
- Since:
- v1
-
setUpdatedAt
public void setUpdatedAt(long updatedAt)
-
isJoined
public boolean isJoined()
Get join information of logged in user in a particular group- Returns:
- true if logged in user is part of the group else false
- Since:
- v1
-
setHasJoined
public void setHasJoined(boolean hasJoined)
-
getJoinedAt
public long getJoinedAt()
Get join at timestamp of logged in user in a particular group- Returns:
- timestamp of joined at of logged in user
- Since:
- v1
-
setJoinedAt
public void setJoinedAt(long joinedAt)
-
getScope
public java.lang.String getScope()
Get scope of logged in user in a particular group- Returns:
- scope of logged in user
- Since:
- v1
-
setScope
public void setScope(java.lang.String scope)
-
getMembersCount
public int getMembersCount()
Get number of members that are a part of the group- Returns:
- number of participants for the group
- Since:
- v1
-
setMembersCount
public void setMembersCount(int membersCount)
-
getTags
public java.util.List<java.lang.String> getTags()
Get the tags that are specified for the group- Returns:
- number of participants for the group
- Since:
- v2.1.6
-
setTags
public void setTags(java.util.List<java.lang.String> tags)
-
toMap
public java.util.HashMap<java.lang.String,java.lang.String> toMap()
-
fromJson
public static Group fromJson(java.lang.String json)
-
fromJSONArray
public static java.util.List<Group> fromJSONArray(java.lang.String response) throws JSONException
- Throws:
JSONException
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-