Package com.fauna.codec
Interface CodecRegistry
-
- All Known Implementing Classes:
DefaultCodecRegistry
public interface CodecRegistry
Interface defining a registry for codecs, which manage the serialization and deserialization of objects.Provides methods for storing, retrieving, and checking for codecs by their unique keys.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description boolean
contains(CodecRegistryKey key)
Checks if a codec is registered under the specified key.<T> Codec<T>
get(CodecRegistryKey key)
Retrieves the codec associated with the specified key.<T> void
put(CodecRegistryKey key, Codec<T> codec)
Registers a codec with the specified key in the registry.
-
-
-
Method Detail
-
get
<T> Codec<T> get(CodecRegistryKey key)
Retrieves the codec associated with the specified key.- Type Parameters:
T
- The type of the object handled by the codec.- Parameters:
key
- The unique key representing the codec.- Returns:
- The codec associated with the specified key, or
null
if not found.
-
put
<T> void put(CodecRegistryKey key, Codec<T> codec)
Registers a codec with the specified key in the registry.- Type Parameters:
T
- The type of the object handled by the codec.- Parameters:
key
- The unique key representing the codec.codec
- The codec to register.
-
contains
boolean contains(CodecRegistryKey key)
Checks if a codec is registered under the specified key.- Parameters:
key
- The unique key representing the codec.- Returns:
true
if a codec exists for the specified key;false
otherwise.
-
-