public interface ISFSObject
Modifier and Type | Method and Description |
---|---|
boolean |
containsKey(java.lang.String key)
Looks for a specific key in the object
|
SFSDataWrapper |
get(java.lang.String key) |
java.lang.Boolean |
getBool(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.Byte |
getByte(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.Object |
getClass(java.lang.String key)
Get the element for the specified key as a Class instance.
|
java.lang.Double |
getDouble(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.String |
getDump()
Get a detailed dump of the SFSObject structure
|
java.lang.String |
getDump(boolean noFormat)
Get a detailed dump of the SFSObject structure
|
java.lang.Float |
getFloat(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.String |
getHexDump()
Get a pretty-printed hex-dump of the object
|
java.lang.Integer |
getInt(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 keys
|
java.lang.Long |
getLong(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.
|
ISFSArray |
getSFSArray(java.lang.String key)
Get the element for the specified key as ISFSArray.
|
ISFSObject |
getSFSObject(java.lang.String key)
Get the element for the specified key as ISFSObject.
|
java.lang.Short |
getShort(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.String |
getText(java.lang.String key)
Get the element for the specified key as String using UTF-8 encoding.
|
java.lang.Integer |
getUnsignedByte(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.String |
getUtfString(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.
|
boolean |
isNull(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() |
void |
put(java.lang.String key,
SFSDataWrapper wrappedObject) |
void |
putBool(java.lang.String key,
boolean value)
Add a boolean
|
void |
putBoolArray(java.lang.String key,
java.util.Collection<java.lang.Boolean> value)
Add a Collection of boolean
|
void |
putByte(java.lang.String key,
byte value)
Add a byte (signed 8-bit)
|
void |
putByteArray(java.lang.String key,
byte[] value)
Add an array of bytes
NOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.
|
void |
putClass(java.lang.String key,
java.lang.Object o)
Add a Class instance.
|
void |
putDouble(java.lang.String key,
double value)
Add a double value (signed 32-bit)
|
void |
putDoubleArray(java.lang.String key,
java.util.Collection<java.lang.Double> value)
Add a Collection of double
|
void |
putFloat(java.lang.String key,
float value)
Add a float value (signed 32-bit)
|
void |
putFloatArray(java.lang.String key,
java.util.Collection<java.lang.Float> value)
Add a Collection of float
|
void |
putInt(java.lang.String key,
int value)
Add a short value (signed 32-bit)
|
void |
putIntArray(java.lang.String key,
java.util.Collection<java.lang.Integer> value)
Add a Collection of int
|
void |
putLong(java.lang.String key,
long value)
Add a long value (signed 32-bit)
|
void |
putLongArray(java.lang.String key,
java.util.Collection<java.lang.Long> value)
Add a Collection of long
|
void |
putNull(java.lang.String key)
Add a null field to the Object.
|
void |
putSFSArray(java.lang.String key,
ISFSArray value)
Add a nested ISFSArray
|
void |
putSFSObject(java.lang.String key,
ISFSObject value)
Add a nested SFSObject
|
void |
putShort(java.lang.String key,
short value)
Add a short value (signed 16-bit)
|
void |
putShortArray(java.lang.String key,
java.util.Collection<java.lang.Short> value)
Add a Collection of short
|
void |
putText(java.lang.String key,
java.lang.String value)
Add a string value (encoded in UTF-8), with a limit of 2 GBytes.
|
void |
putUtfString(java.lang.String key,
java.lang.String value)
Add a string value (encoded in UTF-8), with a limit of 32 KBytes.
|
void |
putUtfStringArray(java.lang.String key,
java.util.Collection<java.lang.String> value)
Add a Collection of string
|
boolean |
removeElement(java.lang.String key)
Remove an element in the object
|
int |
size()
Get the size of the SFSObject
|
byte[] |
toBinary()
Return a binary representation of the object
|
java.lang.String |
toJson()
Return a JSON representation of the object
|
boolean isNull(java.lang.String key)
key
- the property nameboolean containsKey(java.lang.String key)
boolean removeElement(java.lang.String key)
key
- the element namejava.util.Set<java.lang.String> getKeys()
int size()
java.util.Iterator<java.util.Map.Entry<java.lang.String,SFSDataWrapper>> iterator()
byte[] toBinary()
java.lang.String toJson()
java.lang.String getDump()
java.lang.String getDump(boolean noFormat)
noFormat
- if true the dump will not be pretty-printedjava.lang.String getHexDump()
SFSDataWrapper get(java.lang.String key)
java.lang.Boolean getBool(java.lang.String key)
key
- java.lang.Byte getByte(java.lang.String key)
key
- java.lang.Integer getUnsignedByte(java.lang.String key)
key
- java.lang.Short getShort(java.lang.String key)
key
- java.lang.Integer getInt(java.lang.String key)
key
- java.lang.Long getLong(java.lang.String key)
key
- java.lang.Float getFloat(java.lang.String key)
key
- java.lang.Double getDouble(java.lang.String key)
key
- java.lang.String getUtfString(java.lang.String key)
The string is limited to 32 KBytes
key
- java.lang.String getText(java.lang.String key)
The string is limited to 2 GBytes
key
- java.util.Collection<java.lang.Boolean> getBoolArray(java.lang.String key)
key
- byte[] getByteArray(java.lang.String key)
NOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.
key
- java.util.Collection<java.lang.Integer> getUnsignedByteArray(java.lang.String key)
key
- java.util.Collection<java.lang.Short> getShortArray(java.lang.String key)
key
- java.util.Collection<java.lang.Integer> getIntArray(java.lang.String key)
key
- java.util.Collection<java.lang.Long> getLongArray(java.lang.String key)
key
- java.util.Collection<java.lang.Float> getFloatArray(java.lang.String key)
key
- java.util.Collection<java.lang.Double> getDoubleArray(java.lang.String key)
key
- java.util.Collection<java.lang.String> getUtfStringArray(java.lang.String key)
key
- ISFSArray getSFSArray(java.lang.String key)
key
- ISFSArray
ISFSObject getSFSObject(java.lang.String key)
key
- java.lang.Object getClass(java.lang.String key)
NOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.
key
- SFSObject.newFromObject(Object)
void putNull(java.lang.String key)
This method will effectively add the key and a byte id to describe the Null value, thus "bloating" the message
key
- the property namevoid putBool(java.lang.String key, boolean value)
key
- the property namevalue
- the valuevoid putByte(java.lang.String key, byte value)
key
- the property namevalue
- the valuegetUnsignedByte(String)
void putShort(java.lang.String key, short value)
key
- the property namevalue
- the valuevoid putInt(java.lang.String key, int value)
key
- the property namevalue
- the valuevoid putLong(java.lang.String key, long value)
key
- the property namevalue
- the valuevoid putFloat(java.lang.String key, float value)
key
- the property namevalue
- the valuevoid putDouble(java.lang.String key, double value)
key
- the property namevalue
- the valuevoid putUtfString(java.lang.String key, java.lang.String value)
key
- the property namevalue
- the valuevoid putText(java.lang.String key, java.lang.String value)
key
- the property namevalue
- the valuevoid putBoolArray(java.lang.String key, java.util.Collection<java.lang.Boolean> value)
key
- the property namevalue
- the valuevoid putByteArray(java.lang.String key, byte[] value)
NOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.
key
- the property namevalue
- the valuevoid putShortArray(java.lang.String key, java.util.Collection<java.lang.Short> value)
key
- the property namevalue
- the valuevoid putIntArray(java.lang.String key, java.util.Collection<java.lang.Integer> value)
key
- the property namevalue
- the valuevoid putLongArray(java.lang.String key, java.util.Collection<java.lang.Long> value)
key
- the property namevalue
- the valuevoid putFloatArray(java.lang.String key, java.util.Collection<java.lang.Float> value)
key
- the property namevalue
- the valuevoid putDoubleArray(java.lang.String key, java.util.Collection<java.lang.Double> value)
key
- the property namevalue
- the valuevoid putUtfStringArray(java.lang.String key, java.util.Collection<java.lang.String> value)
key
- the property namevalue
- the valuevoid putSFSArray(java.lang.String key, ISFSArray value)
key
- the property namevalue
- the valueISFSArray
void putSFSObject(java.lang.String key, ISFSObject value)
key
- the property namevalue
- the valuevoid putClass(java.lang.String key, java.lang.Object o)
SerializableSFSType
interface.key
- the property nameo
- the instance
NOTE: This is not supported for HTML5 / Websocket clients, which includes Unity WebGL exports.
SFSObject.newFromObject(Object)
void put(java.lang.String key, SFSDataWrapper wrappedObject)