Package io.objectbox.converter
Class IntegerLongMapConverter
java.lang.Object
io.objectbox.converter.FlexObjectConverter
io.objectbox.converter.IntegerFlexMapConverter
io.objectbox.converter.IntegerLongMapConverter
- All Implemented Interfaces:
PropertyConverter<Object,
byte[]>
Like
IntegerFlexMapConverter
, but always restores integer map values as Long
.
Used by default to convert Map<Integer, Long>
.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
shouldRestoreAsLong
(io.objectbox.flatbuffers.FlexBuffers.Reference reference) Returns true if the width in bytes stored in the private parentWidth field of FlexBuffers.Reference is 8.Methods inherited from class io.objectbox.converter.IntegerFlexMapConverter
checkMapKeyType
Methods inherited from class io.objectbox.converter.FlexObjectConverter
convertToDatabaseValue, convertToEntityProperty
-
Constructor Details
-
IntegerLongMapConverter
public IntegerLongMapConverter()
-
-
Method Details
-
shouldRestoreAsLong
protected boolean shouldRestoreAsLong(io.objectbox.flatbuffers.FlexBuffers.Reference reference) Description copied from class:FlexObjectConverter
Returns true if the width in bytes stored in the private parentWidth field of FlexBuffers.Reference is 8. Note: FlexBuffers stores all items in a map/vector using the size of the widest item. However, an item's size is only as wide as needed, e.g. a 64-bit integer (Java Long, 8 bytes) will be reduced to 1 byte if it does not exceed its value range.- Overrides:
shouldRestoreAsLong
in classFlexObjectConverter
-