![JAR search and dependency download from the Maven repository](/logo.png)
org.infinispan.server.resp.serialization.SerializationHint Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-server-resp Show documentation
Show all versions of infinispan-server-resp Show documentation
Infinispan Resp Protocol Server
package org.infinispan.server.resp.serialization;
import org.infinispan.server.resp.ByteBufPool;
/**
* Hints the serializer for nested object's type.
*
*
* Nested objects, such as arrays and maps, are nested with many objects. The hint aids the serializer in identifying the
* type of elements inside the structure. This approach avoids traversing the complete list of serializers in the system.
*
*
*
* The hints only work for 1-level nested objects. Deeply nested or heterogeneous structures utilize an unknown hint and
* search the registry for a match. There is a distinction between {@link SimpleHint} and {@link KeyValueHint}.
*
*
* @author José Bolina
*/
interface SerializationHint {
/**
* Provide hints of simple primitive elements.
*/
interface SimpleHint extends SerializationHint {
/**
* Identify the underlying RESP3 type.
*/
void serialize(Object object, ByteBufPool alloc);
}
/**
* Provide hints of types for key-value structures.
*
*
* Composes two {@link SimpleHint} to identify the key and value types. Therefore, key and value types must be homogeneous.
*
*
* @param key The type of keys in the structure.
* @param value The type of values in the structure.
*/
record KeyValueHint(SimpleHint key, SimpleHint value) implements SerializationHint { }
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy