![JAR search and dependency download from the Maven repository](/logo.png)
org.infinispan.server.resp.serialization.JavaObjectSerializer 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;
/**
* Base class for serializing custom Java objects into the final RESP3 format.
*
*
* Extend this class to add support to a Java object type. This mechanism is useful when handling methods that return
* an object instead of the primitive values. Also, nested data structures with heterogeneous elements must provide
* an instance of {@link JavaObjectSerializer} to correctly the elements.
*
*
* An example of how to utilize the serializer when handling a heterogeneous map. The map contains string and integer
* values.
*
*
* {@code
* class MyCustomSerializer extends JavaObjectSerializer
*
*
* The caller can also provide a lambda that receives the response and the {@link org.infinispan.server.resp.ByteBufPool}
* as arguments for serialization. If a serializer is stateless, it can be a singleton and shared for all invocations.
*
*
* @param The type of object the instance is handling. This type filter the objects during runtime, accepting types
* of T and subclasses.
*/
@FunctionalInterface
public interface JavaObjectSerializer extends ResponseSerializer {
@Override
default boolean test(Object object) {
return true;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy