com.techventus.server.voice.datatypes
Class Group

java.lang.Object
  extended by com.techventus.server.voice.datatypes.Group

public class Group
extends java.lang.Object

Author:
Tobias Eisentraeger

Constructor Summary
Group(gvjava.org.json.JSONObject jsonObject)
           
Group(java.lang.String id, java.lang.String name, boolean isCustomForwarding, DisabledForwardingId[] disabledForwardingIdsNeu, boolean isCustomDirectConnect, boolean directConnect, boolean isCustomGreeting, int greetingId)
           
Group(java.lang.String id, java.lang.String name, boolean isCustomForwarding, java.util.List<DisabledForwardingId> disabledForwardingIds, boolean isCustomDirectConnect, boolean directConnect, boolean isCustomGreeting, int greetingId)
           
 
Method Summary
static Group[] createArrayFromJsonObject(gvjava.org.json.JSONObject groupsJSON)
           
static java.util.List<Group> createGroupSettingsFromJsonResponse(java.lang.String json)
          Constructs an Object from the json Resonse
static gvjava.org.json.JSONObject[] createJSONObjectArrayFromJsonObject(gvjava.org.json.JSONObject settingsJSON)
           
static gvjava.org.json.JSONObject createJSONObjectFromJsonObject(gvjava.org.json.JSONObject settingsJSON)
           
 java.util.List<DisabledForwardingId> getDisabledForwardingIds()
           
 int getGreetingId()
           
 java.lang.String getId()
           
 java.lang.String getName()
           
static java.lang.Object groupsArrayToJsonObject(Group[] groups)
          Groups array to json object.
 boolean isCustomDirectConnect()
           
 boolean isCustomForwarding()
           
 boolean isCustomGreeting()
           
 boolean isDirectConnect()
           
 boolean isPhoneDisabled(int phoneId)
          Query disabled status - if id not found, then it returns false, which means enabled.
static java.lang.String listToJson(java.util.List<Group> pGroupSettings)
          Creates a complete json of a list of Group "groups":{"15":{..details of group id 15..},"12":{..details of group id 12..}}
 void setCustomDirectConnect(boolean isCustomDirectConnect)
           
 void setCustomForwarding(boolean isCustomForwarding)
           
 void setCustomGreeting(boolean isCustomGreeting)
           
 void setDirectConnect(boolean directConnect)
           
 void setDisabledForwardingIds(java.util.List<DisabledForwardingId> disabledForwardingIds)
           
 void setGreetingId(int greetingId)
           
 void setId(java.lang.String id)
           
 void setName(java.lang.String name)
           
 java.lang.String toJson()
           
 gvjava.org.json.JSONObject toJsonObject()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Group

public Group(java.lang.String id,
             java.lang.String name,
             boolean isCustomForwarding,
             java.util.List<DisabledForwardingId> disabledForwardingIds,
             boolean isCustomDirectConnect,
             boolean directConnect,
             boolean isCustomGreeting,
             int greetingId)

Group

public Group(java.lang.String id,
             java.lang.String name,
             boolean isCustomForwarding,
             DisabledForwardingId[] disabledForwardingIdsNeu,
             boolean isCustomDirectConnect,
             boolean directConnect,
             boolean isCustomGreeting,
             int greetingId)

Group

public Group(gvjava.org.json.JSONObject jsonObject)
      throws gvjava.org.json.JSONException
Parameters:
jsonObject -
Throws:
gvjava.org.json.JSONException
Method Detail

createGroupSettingsFromJsonResponse

public static final java.util.List<Group> createGroupSettingsFromJsonResponse(java.lang.String json)
Constructs an Object from the json Resonse

Parameters:
json -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toJson

public java.lang.String toJson()

toJsonObject

public gvjava.org.json.JSONObject toJsonObject()

listToJson

public static java.lang.String listToJson(java.util.List<Group> pGroupSettings)
Creates a complete json of a list of Group "groups":{"15":{..details of group id 15..},"12":{..details of group id 12..}}

Parameters:
pGroupSettings - the group settings
Returns:
the JSON string

getId

public java.lang.String getId()
Returns:
the id

getName

public java.lang.String getName()
Returns:
the name

isCustomForwarding

public boolean isCustomForwarding()
Returns:
the isCustomForwarding - Call Presentation

getDisabledForwardingIds

public java.util.List<DisabledForwardingId> getDisabledForwardingIds()
Returns:
the disabledForwardingIds

isCustomDirectConnect

public boolean isCustomDirectConnect()
Returns:
the isCustomDirectConnect

isDirectConnect

public boolean isDirectConnect()
Returns:
the directConnect

isCustomGreeting

public boolean isCustomGreeting()
Returns:
the isCustomGreeting

getGreetingId

public int getGreetingId()
Returns:
the greetingId

setId

public void setId(java.lang.String id)
Parameters:
id - the id to set

setName

public void setName(java.lang.String name)
Parameters:
name - the name to set

setCustomForwarding

public void setCustomForwarding(boolean isCustomForwarding)
Parameters:
isCustomForwarding - the isCustomForwarding to set

setDisabledForwardingIds

public void setDisabledForwardingIds(java.util.List<DisabledForwardingId> disabledForwardingIds)
Parameters:
disabledForwardingIds - the disabledForwardingIds to set

setCustomDirectConnect

public void setCustomDirectConnect(boolean isCustomDirectConnect)
Parameters:
isCustomDirectConnect - the isCustomDirectConnect to set

setDirectConnect

public void setDirectConnect(boolean directConnect)
Parameters:
directConnect - the directConnect to set

setCustomGreeting

public void setCustomGreeting(boolean isCustomGreeting)
Parameters:
isCustomGreeting - the isCustomGreeting to set

setGreetingId

public void setGreetingId(int greetingId)
Parameters:
greetingId - the greetingId to set

createArrayFromJsonObject

public static final Group[] createArrayFromJsonObject(gvjava.org.json.JSONObject groupsJSON)
                                               throws gvjava.org.json.JSONException
Throws:
gvjava.org.json.JSONException

createJSONObjectArrayFromJsonObject

public static final gvjava.org.json.JSONObject[] createJSONObjectArrayFromJsonObject(gvjava.org.json.JSONObject settingsJSON)
                                                                              throws gvjava.org.json.JSONException
Throws:
gvjava.org.json.JSONException

createJSONObjectFromJsonObject

public static final gvjava.org.json.JSONObject createJSONObjectFromJsonObject(gvjava.org.json.JSONObject settingsJSON)
                                                                       throws gvjava.org.json.JSONException
Throws:
gvjava.org.json.JSONException

groupsArrayToJsonObject

public static java.lang.Object groupsArrayToJsonObject(Group[] groups)
                                                throws gvjava.org.json.JSONException
Groups array to json object.

Parameters:
groups - the groups
Returns:
the object
Throws:
gvjava.org.json.JSONException - the jSON exception

isPhoneDisabled

public boolean isPhoneDisabled(int phoneId)
Query disabled status - if id not found, then it returns false, which means enabled.

Parameters:
phoneId - the phone id
Returns:
true, if is phone disabled