-
- All Implemented Interfaces:
-
com.facebook.react.common.mapbuffer.MapBuffer
,kotlin.collections.Iterable
@NotThreadSafe() public final class WritableMapBuffer implements MapBuffer
Implementation of writeable Java-only MapBuffer, which can be used to send information through JNI.
See MapBuffer for more details
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public class
WritableMapBuffer.Companion
-
Constructor Summary
Constructors Constructor Description WritableMapBuffer()
-
Method Summary
Modifier and Type Method Description Integer
getCount()
final WritableMapBuffer
put(Integer key, Boolean value)
Adds a boolean value for given key to the MapBuffer. final WritableMapBuffer
put(Integer key, Integer value)
Adds an int value for given key to the MapBuffer. final WritableMapBuffer
put(Integer key, Double value)
Adds a double value for given key to the MapBuffer. final WritableMapBuffer
put(Integer key, String value)
Adds a string value for given key to the MapBuffer. final WritableMapBuffer
put(Integer key, MapBuffer value)
Adds a MapBuffer value for given key to the current MapBuffer. Boolean
contains(Integer key)
Checks whether entry for given key exists in MapBuffer. Integer
getKeyOffset(Integer key)
Provides offset of the key to use for entryAt, for cases when offset is not statically known but can be cached. MapBuffer.Entry
entryAt(Integer offset)
Provides parsed access to a MapBuffer without additional lookups for provided offset. MapBuffer.DataType
getType(Integer key)
Provides parsed DataType annotation associated with the given key. Boolean
getBoolean(Integer key)
Provides parsed Boolean value if the entry for given key exists with DataType.BOOL type Integer
getInt(Integer key)
Provides parsed Int value if the entry for given key exists with DataType.INT type Double
getDouble(Integer key)
Provides parsed Double value if the entry for given key exists with DataType.DOUBLE type String
getString(Integer key)
Provides parsed String value if the entry for given key exists with DataType.STRING type MapBuffer
getMapBuffer(Integer key)
Provides parsed MapBuffer value if the entry for given key exists with DataType.MAP type Iterator<MapBuffer.Entry>
iterator()
-
-
Method Detail
-
put
final WritableMapBuffer put(Integer key, Boolean value)
Adds a boolean value for given key to the MapBuffer.
- Parameters:
key
- entry keyvalue
- entry value
-
put
final WritableMapBuffer put(Integer key, Integer value)
Adds an int value for given key to the MapBuffer.
- Parameters:
key
- entry keyvalue
- entry value
-
put
final WritableMapBuffer put(Integer key, Double value)
Adds a double value for given key to the MapBuffer.
- Parameters:
key
- entry keyvalue
- entry value
-
put
final WritableMapBuffer put(Integer key, String value)
Adds a string value for given key to the MapBuffer.
- Parameters:
key
- entry keyvalue
- entry value
-
put
final WritableMapBuffer put(Integer key, MapBuffer value)
Adds a MapBuffer value for given key to the current MapBuffer.
- Parameters:
key
- entry keyvalue
- entry value
-
contains
Boolean contains(Integer key)
Checks whether entry for given key exists in MapBuffer.
- Parameters:
key
- key to lookup the entry
-
getKeyOffset
Integer getKeyOffset(Integer key)
Provides offset of the key to use for entryAt, for cases when offset is not statically known but can be cached.
- Parameters:
key
- key to lookup offset for
-
entryAt
MapBuffer.Entry entryAt(Integer offset)
Provides parsed access to a MapBuffer without additional lookups for provided offset.
- Parameters:
offset
- offset of entry in the MapBuffer structure.
-
getType
MapBuffer.DataType getType(Integer key)
Provides parsed DataType annotation associated with the given key.
- Parameters:
key
- key to lookup type for
-
getBoolean
Boolean getBoolean(Integer key)
Provides parsed Boolean value if the entry for given key exists with DataType.BOOL type
- Parameters:
key
- key to lookup Boolean value for
-
getInt
Integer getInt(Integer key)
Provides parsed Int value if the entry for given key exists with DataType.INT type
- Parameters:
key
- key to lookup Int value for
-
getDouble
Double getDouble(Integer key)
Provides parsed Double value if the entry for given key exists with DataType.DOUBLE type
- Parameters:
key
- key to lookup Double value for
-
getString
String getString(Integer key)
Provides parsed String value if the entry for given key exists with DataType.STRING type
- Parameters:
key
- key to lookup String value for
-
getMapBuffer
MapBuffer getMapBuffer(Integer key)
Provides parsed MapBuffer value if the entry for given key exists with DataType.MAP type
- Parameters:
key
- key to lookup MapBuffer value for
-
iterator
Iterator<MapBuffer.Entry> iterator()
-
-
-
-