Class MapObjectSerializer
java.lang.Object
eu.cloudnetservice.driver.impl.network.object.serializers.MapObjectSerializer
- All Implemented Interfaces:
eu.cloudnetservice.driver.network.object.ObjectSerializer<Map<?,?>>
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateMapObjectSerializer(@NonNull IntFunction<Map<Object, Object>> mapFactory) Constructs a new map object serializer instance. -
Method Summary
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface eu.cloudnetservice.driver.network.object.ObjectSerializer
preReadCheckAccepts, preWriteCheckAccepts
-
Field Details
-
mapFactory
-
-
Constructor Details
-
MapObjectSerializer
Constructs a new map object serializer instance.- Parameters:
mapFactory- the map factory to use to construct the map instances.- Throws:
NullPointerException- if the given map factory is null.
-
-
Method Details
-
of
@NonNull public static @NonNull MapObjectSerializer of(@NonNull @NonNull IntFunction<Map<Object, Object>> mapFactory) Constructs a new map object serializer instance.- Parameters:
mapFactory- the map factory to use to construct the map instances, receiving the map size as parameter.- Returns:
- the created map object serializer instance.
- Throws:
NullPointerException- if the given map factory is null.
-
read
@Nullable public @Nullable Map<?,?> read(@NonNull @NonNull eu.cloudnetservice.driver.network.buffer.DataBuf source, @NonNull @NonNull Type type, @NonNull @NonNull eu.cloudnetservice.driver.network.object.ObjectMapper caller) - Specified by:
readin interfaceeu.cloudnetservice.driver.network.object.ObjectSerializer<Map<?,?>>
-
write
public void write(@NonNull eu.cloudnetservice.driver.network.buffer.DataBuf.Mutable dataBuf, @NonNull @NonNull Map<?, ?> object, @NonNull @NonNull Type type, @NonNull @NonNull eu.cloudnetservice.driver.network.object.ObjectMapper caller) - Specified by:
writein interfaceeu.cloudnetservice.driver.network.object.ObjectSerializer<Map<?,?>>
-