SAP Customer Data Cloud Positions

Class GSObject

Skip to end of metadata
Go to start of metadata



Used for passing parameters, for example when issuing requests or receiving response data. The object holds [key, value] pairs. The key represents a parameter name (type String) and the value may be one of the following types:



GSObject()Default constructor.
GSObject(string json)Construct a GSObject from a JSON string. Throws an Exception if unable to parse the JSON string.




ReturnMethod Description
voidClear()Removes all of the entries from this object. The object will be empty after this call returns.
GSObjectClone()Creates and returns a deep copy of this object.
boolContainsKey(string key)Returns true if this object contains mapping for the specified key.
intGetInt(string key)Methods for retrieving value by key.
For the methods without defaultValue, the method throws GSKeyNotFoundException, if the key is not found.
intGetInt(string key,
     int defaultValue)
longGetLong(string key)
longGetLong(string key,
     long defaultValue)
doubleGetDouble(string key)
doubleGetDouble(string key,
     double defaultValue)
boolGetBool(string key)
boolGetBool(string key,
     bool defaultValue)
stringGetString(string key)
stringGetString(string key,
     string defaultValue)
GSObjectGetObject(string key)
GSObjectGetObject(string key,
     GSObject defaultValue)
GSArrayGetArray(string key)
GSArrayGetArray(string key,
     GSArray defaultValue)
SortedDictionary.KeyCollectionGetKeys()Returns a strings array of all the keys in this object.
voidParseQuerystring(string qs)Parses parameters from a query string into this object.
voidParseURL(string url)Parses parameters from a URL string into this object.
GSObjectPut(string key, string value)Methods for adding a [key, value] pair to this object. If the object previously contained a mapping for the key, the old value is replaced by the specified value.
GSObjectPut(string key, int value)
GSObjectPut(string key, long value)
GSObjectPut(string key, bool value)
GSObjectPut(string key, double value)
GSObjectPut(string key,
       GSObject value)
GSObjectPut(string key,
      GSArray value)
voidRemove(string key)Removes the key (and its corresponding value) from this object. This method does nothing if the key is not in this object.
stringToJsonString()Returns this object's content as a JSON string.
stringToString()Returns  this object's content as a JSON string.