Class SFSObject
- java.lang.Object
-
- com.smartfoxserver.v2.entities.data.SFSObject
-
- All Implemented Interfaces:
ISFSObject,java.io.Serializable
- Direct Known Subclasses:
SFSObjectLite
public class SFSObject extends java.lang.Object implements ISFSObject, java.io.Serializable
SFSObject and SFSArray represent a platform-neutral, high level objects that abstract the data transport between client and server. They are used to respectively represent data in form of a Map/Dictionary or List/Array and they can be nested and transport many different data types (from bytes to integers, doubles, strings and a lot more)These two classes provide a fine-grained control over each data item sent over the network and provide high speed serialization using the default SFS2X binary protocol.
Let's consider this simple example: we need to send the data relative to a combat vehicle in a multiplayer game.
ISFSObject sfso = new SFSObject(); sfso.putByte("id", 10); sfso.putShort("health", 5000); sfso.putIntArray("pos", Arrays.asList(120,150)); sfso.putUtfString("name", "Hurricane");In the above code we can use a single Byte (signed 8-bit) to send any small integer value, a Short (signed 16-bit) for larger values and integers for any number that should be represented as regular 32-bit value.The following is a list of type supported by the SFSObject class:
- null
- boolean
- byte
- short
- int
- long
- float
- double
- utf-string
- boolean array
- byte array
- short array
- int array
- long array
- float array
- double array
- utf-string array
- SFSObject
- SFSArray
NOTE: UTF-8/multi-byte strings are not supported in key names. In other words you should restrict key names to standard ASCII characters.
It is also recommended to keep key names very short to save bandwidth. Strings values, instead, are handled via UTF-8 encoding, to support all languages and character sets. SFSObjects and SFSArrays can be nested to create complex data structures.Limitations: UTF Strings length is expressed using a signed short integer which means that a string can be up to 32768 characters. (Sending a larger text can be done via set/getText methods) The same applies to all the array types whose length is encoded in the same way, thus limiting the max length of an array to 32768 elements.
NOTE: SFSObject is not thread safe.
- See Also:
SFSArray, Serialized Form
-
-
Constructor Summary
Constructors Constructor Description SFSObject()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontainsKey(java.lang.String key)Looks for a specific key in the objectSFSDataWrapperget(java.lang.String key)java.lang.BooleangetBool(java.lang.String key)Get the element for the specified key as Boolean.java.util.Collection<java.lang.Boolean>getBoolArray(java.lang.String key)Get the element for the specified key as a Collection of Booleans.java.lang.BytegetByte(java.lang.String key)Get the element for the specified key as Byte (signed 8 bit).byte[]getByteArray(java.lang.String key)Get the element for the specified key as a Collection of Byte.java.lang.ObjectgetClass(java.lang.String key)Get the element for the specified key as a Class instance.java.lang.DoublegetDouble(java.lang.String key)Get the element for the specified key as Double (signed decimal 64 bit).java.util.Collection<java.lang.Double>getDoubleArray(java.lang.String key)Get the element for the specified key as a Collection of Double.java.lang.StringgetDump()Get a detailed dump of the SFSObject structurejava.lang.StringgetDump(boolean noFormat)Get a detailed dump of the SFSObject structurejava.lang.FloatgetFloat(java.lang.String key)Get the element for the specified key as Float (signed decimal 32 bit).java.util.Collection<java.lang.Float>getFloatArray(java.lang.String key)Get the element for the specified key as a Collection of Float.java.lang.StringgetHexDump()Get a pretty-printed hex-dump of the objectjava.lang.IntegergetInt(java.lang.String key)Get the element for the specified key as Integer (signed 32 bit).java.util.Collection<java.lang.Integer>getIntArray(java.lang.String key)Get the element for the specified key as a Collection of Integer.java.util.Set<java.lang.String>getKeys()Get a Set of all keysjava.lang.LonggetLong(java.lang.String key)Get the element for the specified key as Long (signed 64 bit).java.util.Collection<java.lang.Long>getLongArray(java.lang.String key)Get the element for the specified key as a Collection of Long.ISFSArraygetSFSArray(java.lang.String key)Get the element for the specified key as ISFSArray.ISFSObjectgetSFSObject(java.lang.String key)Get the element for the specified key as ISFSObject.java.lang.ShortgetShort(java.lang.String key)Get the element for the specified key as Short (signed 16 bit).java.util.Collection<java.lang.Short>getShortArray(java.lang.String key)Get the element for the specified key as a Collection of Short.java.lang.StringgetText(java.lang.String key)Get the element for the specified key as String using UTF-8 encoding.java.lang.IntegergetUnsignedByte(java.lang.String key)Get the element for the specified key as unsigned byte.java.util.Collection<java.lang.Integer>getUnsignedByteArray(java.lang.String key)Get the element for the specified key as a Collection of unsigned Byte.java.lang.StringgetUtfString(java.lang.String key)Get the element for the specified key as String using UTF-8 encoding.java.util.Collection<java.lang.String>getUtfStringArray(java.lang.String key)Get the element for the specified key as a Collection of String.booleanisNull(java.lang.String key)Checks if a specific element is of SFSDataType.NULL.java.util.Iterator<java.util.Map.Entry<java.lang.String,SFSDataWrapper>>iterator()static SFSObjectnewFromBinaryData(byte[] bytes)Rebuild an SFSObject form its binary formstatic ISFSObjectnewFromJsonData(java.lang.String jsonStr)Creates an SFSObject from a JSON literal.static SFSObjectnewFromObject(java.lang.Object o)Converts any POJO (Plain Old Java Object) into an SFSObject providing a number of conventions and supported data types.static SFSObjectnewFromResultSet(java.sql.ResultSet rset)static SFSObjectnewInstance()Static constructor, similar to new SFSObject();voidput(java.lang.String key, SFSDataWrapper wrappedObject)voidputBool(java.lang.String key, boolean value)Add a booleanvoidputBoolArray(java.lang.String key, java.util.Collection<java.lang.Boolean> value)Add a Collection of booleanvoidputByte(java.lang.String key, byte value)Add a byte (signed 8-bit)voidputByteArray(java.lang.String key, byte[] value)Add an array of bytesvoidputClass(java.lang.String key, java.lang.Object o)Add a Class instance.voidputDouble(java.lang.String key, double value)Add a double value (signed 32-bit)voidputDoubleArray(java.lang.String key, java.util.Collection<java.lang.Double> value)Add a Collection of doublevoidputFloat(java.lang.String key, float value)Add a float value (signed 32-bit)voidputFloatArray(java.lang.String key, java.util.Collection<java.lang.Float> value)Add a Collection of floatvoidputInt(java.lang.String key, int value)Add a short value (signed 32-bit)voidputIntArray(java.lang.String key, java.util.Collection<java.lang.Integer> value)Add a Collection of intvoidputLong(java.lang.String key, long value)Add a long value (signed 32-bit)voidputLongArray(java.lang.String key, java.util.Collection<java.lang.Long> value)Add a Collection of longvoidputNull(java.lang.String key)Add a null field to the Object.voidputSFSArray(java.lang.String key, ISFSArray value)Add a nested ISFSArrayvoidputSFSObject(java.lang.String key, ISFSObject value)Add a nested SFSObjectvoidputShort(java.lang.String key, short value)Add a short value (signed 16-bit)voidputShortArray(java.lang.String key, java.util.Collection<java.lang.Short> value)Add a Collection of shortvoidputText(java.lang.String key, java.lang.String value)Add a string value (encoded in UTF-8), with a limit of 2 GBytes.voidputUtfString(java.lang.String key, java.lang.String value)Add a string value (encoded in UTF-8), with a limit of 32 KBytes.voidputUtfStringArray(java.lang.String key, java.util.Collection<java.lang.String> value)Add a Collection of stringbooleanremoveElement(java.lang.String key)Remove an element in the objectintsize()Get the size of the SFSObjectbyte[]toBinary()Return a binary representation of the objectjava.lang.StringtoJson()Return a JSON representation of the objectjava.lang.StringtoString()
-
-
-
Method Detail
-
newFromObject
public static SFSObject newFromObject(java.lang.Object o)
Converts any POJO (Plain Old Java Object) into an SFSObject providing a number of conventions and supported data types.Supported types:
- null
- boolean, Boolean
- byte, Byte
- short, Short
- int, Integer
- long, Long
- float, Float
- double, Double
- String
- Collection
- Map
- Array types
- Nested POJOs
Other rules:
- Private fields are accessed from regular Java getters/setters, if they don't exist fields are ignored
- Public fields are accessed directly
- Static fields are ignored
- Transient fields are ignored
Conventions: When de-serialized on the other end the system will look for a Class with the same fully qualified name and will attempt to instantiate it and populate with the received data via reflection.
NOTE: complex objects might take up a significantly large amount of bytes compared to regular SFSObjects. If message size is a critical element and Class serialization seem to create too large packets we recommend to add a toSFSObject() and fromSFSObject() methods on your classes to generate smaller representations of the data you need to transfer.
Also, if possible, try to export only the fields that are strictly necessary and using the most suitable data type (e.g a byte or short for small numbers, etc...)
-
newFromBinaryData
public static SFSObject newFromBinaryData(byte[] bytes)
Rebuild an SFSObject form its binary form- Parameters:
bytes- the binary data- Returns:
- the original SFSObject
- Throws:
java.lang.IllegalStateException- if there's any problem with decoding the binary data
-
newFromJsonData
public static ISFSObject newFromJsonData(java.lang.String jsonStr)
Creates an SFSObject from a JSON literal. Type conversion is done as follows:JSON SFSObject Bool Bool Number Integer, Long, Double (autodetect) String UTF String Array SFSArray Object SFSObject - Parameters:
jsonStr- the JSON literal- Returns:
- the SFSObject
-
newFromResultSet
public static SFSObject newFromResultSet(java.sql.ResultSet rset) throws java.sql.SQLException
- Throws:
java.sql.SQLException
-
newInstance
public static SFSObject newInstance()
Static constructor, similar to new SFSObject();- Returns:
- a new SFSObject
-
iterator
public java.util.Iterator<java.util.Map.Entry<java.lang.String,SFSDataWrapper>> iterator()
- Specified by:
iteratorin interfaceISFSObject
-
containsKey
public boolean containsKey(java.lang.String key)
Description copied from interface:ISFSObjectLooks for a specific key in the object- Specified by:
containsKeyin interfaceISFSObject- Returns:
- true if the element exists
-
removeElement
public boolean removeElement(java.lang.String key)
Description copied from interface:ISFSObjectRemove an element in the object- Specified by:
removeElementin interfaceISFSObject- Parameters:
key- the element name- Returns:
- true if the element was really present in the object
-
size
public int size()
Description copied from interface:ISFSObjectGet the size of the SFSObject- Specified by:
sizein interfaceISFSObject- Returns:
- the number of elements contained in the SFSObject
-
toBinary
public byte[] toBinary()
Description copied from interface:ISFSObjectReturn a binary representation of the object- Specified by:
toBinaryin interfaceISFSObject- Returns:
- a binary representation of the object
-
toJson
public java.lang.String toJson()
Description copied from interface:ISFSObjectReturn a JSON representation of the object- Specified by:
toJsonin interfaceISFSObject- Returns:
- a JSON representation of the object
-
getDump
public java.lang.String getDump()
Description copied from interface:ISFSObjectGet a detailed dump of the SFSObject structure- Specified by:
getDumpin interfaceISFSObject- Returns:
- a detailed dump of the SFSObject structure
-
getDump
public java.lang.String getDump(boolean noFormat)
Description copied from interface:ISFSObjectGet a detailed dump of the SFSObject structure- Specified by:
getDumpin interfaceISFSObject- Parameters:
noFormat- if true the dump will not be pretty-printed- Returns:
- a detailed dump of the SFSObject structure
-
getHexDump
public java.lang.String getHexDump()
Description copied from interface:ISFSObjectGet a pretty-printed hex-dump of the object- Specified by:
getHexDumpin interfaceISFSObject- Returns:
- a pretty-printed hex-dump of the object
-
isNull
public boolean isNull(java.lang.String key)
Description copied from interface:ISFSObjectChecks if a specific element is of SFSDataType.NULL.- Specified by:
isNullin interfaceISFSObject- Parameters:
key- the property name- Returns:
- true if the item is null
-
get
public SFSDataWrapper get(java.lang.String key)
- Specified by:
getin interfaceISFSObject
-
getBool
public java.lang.Boolean getBool(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as Boolean. It can be null if no element exists for the specified key- Specified by:
getBoolin interfaceISFSObject- Returns:
- the element, or null
-
getBoolArray
public java.util.Collection<java.lang.Boolean> getBoolArray(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as a Collection of Booleans. It can be null if no element exists for the specified key- Specified by:
getBoolArrayin interfaceISFSObject- Returns:
- the element, or null
-
getByte
public java.lang.Byte getByte(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as Byte (signed 8 bit). It can be null if no element exists for the specified key- Specified by:
getBytein interfaceISFSObject- Returns:
- the element, or null
-
getByteArray
public byte[] getByteArray(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as a Collection of Byte. It can be null if no element exists for the specified keyNOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.
- Specified by:
getByteArrayin interfaceISFSObject- Returns:
- the element, or null
-
getDouble
public java.lang.Double getDouble(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as Double (signed decimal 64 bit). It can be null if no element exists for the specified key- Specified by:
getDoublein interfaceISFSObject- Returns:
- the element, or null
-
getDoubleArray
public java.util.Collection<java.lang.Double> getDoubleArray(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as a Collection of Double. It can be null if no element exists for the specified key- Specified by:
getDoubleArrayin interfaceISFSObject- Returns:
- the element, or null
-
getFloat
public java.lang.Float getFloat(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as Float (signed decimal 32 bit). It can be null if no element exists for the specified key- Specified by:
getFloatin interfaceISFSObject- Returns:
- the element, or null
-
getFloatArray
public java.util.Collection<java.lang.Float> getFloatArray(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as a Collection of Float. It can be null if no element exists for the specified key- Specified by:
getFloatArrayin interfaceISFSObject- Returns:
- the element, or null
-
getInt
public java.lang.Integer getInt(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as Integer (signed 32 bit). It can be null if no element exists for the specified key- Specified by:
getIntin interfaceISFSObject- Returns:
- the element, or null
-
getIntArray
public java.util.Collection<java.lang.Integer> getIntArray(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as a Collection of Integer. It can be null if no element exists for the specified key- Specified by:
getIntArrayin interfaceISFSObject- Returns:
- the element, or null
-
getKeys
public java.util.Set<java.lang.String> getKeys()
Description copied from interface:ISFSObjectGet a Set of all keys- Specified by:
getKeysin interfaceISFSObject- Returns:
- all the keys
-
getLong
public java.lang.Long getLong(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as Long (signed 64 bit). It can be null if no element exists for the specified key- Specified by:
getLongin interfaceISFSObject- Returns:
- the element, or null
-
getLongArray
public java.util.Collection<java.lang.Long> getLongArray(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as a Collection of Long. It can be null if no element exists for the specified key- Specified by:
getLongArrayin interfaceISFSObject- Returns:
- the element, or null
-
getSFSArray
public ISFSArray getSFSArray(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as ISFSArray. It can be null if no element exists for the specified key- Specified by:
getSFSArrayin interfaceISFSObject- Returns:
- the element, or null
- See Also:
ISFSArray
-
getSFSObject
public ISFSObject getSFSObject(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as ISFSObject. It can be null if no element exists for the specified key- Specified by:
getSFSObjectin interfaceISFSObject- Returns:
- the element, or null
-
getShort
public java.lang.Short getShort(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as Short (signed 16 bit). It can be null if no element exists for the specified key- Specified by:
getShortin interfaceISFSObject- Returns:
- the element, or null
-
getShortArray
public java.util.Collection<java.lang.Short> getShortArray(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as a Collection of Short. It can be null if no element exists for the specified key- Specified by:
getShortArrayin interfaceISFSObject- Returns:
- the element, or null
-
getUnsignedByte
public java.lang.Integer getUnsignedByte(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as unsigned byte. It can be null if no element exists for the specified key. This method is useful when you need to represent an int value betwee 0-255. In Java bytes are represented as signed bytes. This will convert the byte to an unsigned int- Specified by:
getUnsignedBytein interfaceISFSObject- Returns:
- the element, or null
-
getUnsignedByteArray
public java.util.Collection<java.lang.Integer> getUnsignedByteArray(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as a Collection of unsigned Byte. It can be null if no element exists for the specified key- Specified by:
getUnsignedByteArrayin interfaceISFSObject- Returns:
- the element, or null
-
getUtfString
public java.lang.String getUtfString(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as String using UTF-8 encoding. It can be null if no element exists for the specified key.The string is limited to 32 KBytes
- Specified by:
getUtfStringin interfaceISFSObject- Returns:
- the element, or null
-
getText
public java.lang.String getText(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as String using UTF-8 encoding. It can be null if no element exists for the specified key.The string is limited to 2 GBytes
- Specified by:
getTextin interfaceISFSObject- Returns:
- the element, or null
-
getUtfStringArray
public java.util.Collection<java.lang.String> getUtfStringArray(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as a Collection of String. It can be null if no element exists for the specified key- Specified by:
getUtfStringArrayin interfaceISFSObject- Returns:
- the element, or null
-
getClass
public java.lang.Object getClass(java.lang.String key)
Description copied from interface:ISFSObjectGet the element for the specified key as a Class instance. The class definition is contained in the instance itself and it will be rebuilt using reflection. It can be null if no element exists for the specified keyNOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.
- Specified by:
getClassin interfaceISFSObject- Returns:
- the element, or null
- See Also:
newFromObject(Object)
-
putBool
public void putBool(java.lang.String key, boolean value)Description copied from interface:ISFSObjectAdd a boolean- Specified by:
putBoolin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putBoolArray
public void putBoolArray(java.lang.String key, java.util.Collection<java.lang.Boolean> value)Description copied from interface:ISFSObjectAdd a Collection of boolean- Specified by:
putBoolArrayin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putByte
public void putByte(java.lang.String key, byte value)Description copied from interface:ISFSObjectAdd a byte (signed 8-bit)- Specified by:
putBytein interfaceISFSObject- Parameters:
key- the property namevalue- the value- See Also:
ISFSObject.getUnsignedByte(String)
-
putByteArray
public void putByteArray(java.lang.String key, byte[] value)Description copied from interface:ISFSObjectAdd an array of bytesNOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.
- Specified by:
putByteArrayin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putDouble
public void putDouble(java.lang.String key, double value)Description copied from interface:ISFSObjectAdd a double value (signed 32-bit)- Specified by:
putDoublein interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putDoubleArray
public void putDoubleArray(java.lang.String key, java.util.Collection<java.lang.Double> value)Description copied from interface:ISFSObjectAdd a Collection of double- Specified by:
putDoubleArrayin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putFloat
public void putFloat(java.lang.String key, float value)Description copied from interface:ISFSObjectAdd a float value (signed 32-bit)- Specified by:
putFloatin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putFloatArray
public void putFloatArray(java.lang.String key, java.util.Collection<java.lang.Float> value)Description copied from interface:ISFSObjectAdd a Collection of float- Specified by:
putFloatArrayin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putInt
public void putInt(java.lang.String key, int value)Description copied from interface:ISFSObjectAdd a short value (signed 32-bit)- Specified by:
putIntin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putIntArray
public void putIntArray(java.lang.String key, java.util.Collection<java.lang.Integer> value)Description copied from interface:ISFSObjectAdd a Collection of int- Specified by:
putIntArrayin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putLong
public void putLong(java.lang.String key, long value)Description copied from interface:ISFSObjectAdd a long value (signed 32-bit)- Specified by:
putLongin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putLongArray
public void putLongArray(java.lang.String key, java.util.Collection<java.lang.Long> value)Description copied from interface:ISFSObjectAdd a Collection of long- Specified by:
putLongArrayin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putNull
public void putNull(java.lang.String key)
Description copied from interface:ISFSObjectAdd a null field to the Object. Normally we recommend that null values are simply not sent. On the other end of the application you can simply check if a specific key exists or not to detect a null.This method will effectively add the key and a byte id to describe the Null value, thus "bloating" the message
- Specified by:
putNullin interfaceISFSObject- Parameters:
key- the property name
-
putSFSArray
public void putSFSArray(java.lang.String key, ISFSArray value)Description copied from interface:ISFSObjectAdd a nested ISFSArray- Specified by:
putSFSArrayin interfaceISFSObject- Parameters:
key- the property namevalue- the value- See Also:
ISFSArray
-
putSFSObject
public void putSFSObject(java.lang.String key, ISFSObject value)Description copied from interface:ISFSObjectAdd a nested SFSObject- Specified by:
putSFSObjectin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putShort
public void putShort(java.lang.String key, short value)Description copied from interface:ISFSObjectAdd a short value (signed 16-bit)- Specified by:
putShortin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putShortArray
public void putShortArray(java.lang.String key, java.util.Collection<java.lang.Short> value)Description copied from interface:ISFSObjectAdd a Collection of short- Specified by:
putShortArrayin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putUtfString
public void putUtfString(java.lang.String key, java.lang.String value)Description copied from interface:ISFSObjectAdd a string value (encoded in UTF-8), with a limit of 32 KBytes.- Specified by:
putUtfStringin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putText
public void putText(java.lang.String key, java.lang.String value)Description copied from interface:ISFSObjectAdd a string value (encoded in UTF-8), with a limit of 2 GBytes.- Specified by:
putTextin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
putUtfStringArray
public void putUtfStringArray(java.lang.String key, java.util.Collection<java.lang.String> value)Description copied from interface:ISFSObjectAdd a Collection of string- Specified by:
putUtfStringArrayin interfaceISFSObject- Parameters:
key- the property namevalue- the value
-
put
public void put(java.lang.String key, SFSDataWrapper wrappedObject)- Specified by:
putin interfaceISFSObject
-
putClass
public void putClass(java.lang.String key, java.lang.Object o)Description copied from interface:ISFSObjectAdd a Class instance. The instance must implement theSerializableSFSTypeinterface.- Specified by:
putClassin interfaceISFSObject- Parameters:
key- the property nameo- the instanceNOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.
- See Also:
newFromObject(Object)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-