v1.0.0
Latest
2022.3+

Class JsonObject

JsonObject class for encapsulating generic object types. We use this to hide internal Json implementation details.

Inheritance
System.Object
JsonObject
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Unity.Services.Lobbies.Http
Syntax
public class JsonObject : IDeserializable

Methods

GetAs<T>()

Overload for returning the object as a defined type but without needing to specify DeserializationSettings.

Declaration
public T GetAs<T>()
Returns
TypeDescription
T

The internal object case to type T.

Type Parameters
NameDescription
T

The type to cast internal object to.

GetAs<T>(DeserializationSettings)

Returns the object as a defined type.

Declaration
public T GetAs<T>(DeserializationSettings deserializationSettings = null)
Parameters
TypeNameDescription
DeserializationSettingsdeserializationSettings

Deserialization settings for how to handle properties like missing members.

Returns
TypeDescription
T

The internal object case to type T.

Type Parameters
NameDescription
T

The type to cast internal object to.

Implements

GetAsString()

Returns the internal object as a string.

Declaration
public string GetAsString()
Returns
TypeDescription
System.String

The internal object as a string.

Implements

GetNewJsonObjectResponse(Dictionary<String, List<Object>>)

Convert dictionary of string, list of object to dictionary of string, list of jsonobject.

Declaration
public static Dictionary<string, List<IDeserializable>> GetNewJsonObjectResponse(Dictionary<string, List<object>> o)
Parameters
TypeNameDescription
System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<System.Object>>o

The dictionary of string to list of objects.

Returns
TypeDescription
System.Collections.Generic.Dictionary<System.String, System.Collections.Generic.List<IDeserializable>>

The dictionary of string, list of jsonobjects.

GetNewJsonObjectResponse(Dictionary<String, Object>)

Convert dictionary of string, object to dictionary of string, jsonobject.

Declaration
public static Dictionary<string, IDeserializable> GetNewJsonObjectResponse(Dictionary<string, object> o)
Parameters
TypeNameDescription
System.Collections.Generic.Dictionary<System.String, System.Object>o

The dictionary of string, objects.

Returns
TypeDescription
System.Collections.Generic.Dictionary<System.String, IDeserializable>

The dictionary of string, jsonobjects.

GetNewJsonObjectResponse(List<List<Object>>)

Convert list of list of object to list of list of jsonobject.

Declaration
public static List<List<IDeserializable>> GetNewJsonObjectResponse(List<List<object>> o)
Parameters
TypeNameDescription
System.Collections.Generic.List<System.Collections.Generic.List<System.Object>>o

The list of list of objects.

Returns
TypeDescription
System.Collections.Generic.List<System.Collections.Generic.List<IDeserializable>>

The list of list of jsonobjects.

GetNewJsonObjectResponse(List<Object>)

Convert list of object to list of jsonobject.

Declaration
public static List<IDeserializable> GetNewJsonObjectResponse(List<object> o)
Parameters
TypeNameDescription
System.Collections.Generic.List<System.Object>o

The list of objects.

Returns
TypeDescription
System.Collections.Generic.List<IDeserializable>

The list of jsonobjects.

GetNewJsonObjectResponse(Object)

Convert object to jsonobject.

Declaration
public static IDeserializable GetNewJsonObjectResponse(object o)
Parameters
TypeNameDescription
System.Objecto

The object.

Returns
TypeDescription
IDeserializable

The jsonobject.