Package com.fauna.codec
Class CodecRegistryKey
- java.lang.Object
-
- com.fauna.codec.CodecRegistryKey
-
public class CodecRegistryKey extends java.lang.Object
Represents a unique key in the codec registry.
-
-
Constructor Summary
Constructors Constructor Description CodecRegistryKey(java.lang.Class<T> clazz, java.lang.reflect.Type[] typeArgs)
Constructs a newCodecRegistryKey
for the specified class and type arguments.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object other)
Compares this key with another object for equality based on the base class and type arguments.static <T> CodecRegistryKey
from(java.lang.Class<T> clazz)
Creates aCodecRegistryKey
for the specified class without any type arguments.static <T> CodecRegistryKey
from(java.lang.Class<T> clazz, java.lang.reflect.Type[] typeArgs)
Creates aCodecRegistryKey
for the specified class and type arguments.int
hashCode()
Returns a hash code for this key, based on the base class and type arguments.
-
-
-
Constructor Detail
-
CodecRegistryKey
public CodecRegistryKey(java.lang.Class<T> clazz, java.lang.reflect.Type[] typeArgs)
Constructs a newCodecRegistryKey
for the specified class and type arguments.- Type Parameters:
T
- The type of the base class.- Parameters:
clazz
- The base class of the codec.typeArgs
- The type arguments for generic types, if applicable.
-
-
Method Detail
-
from
public static <T> CodecRegistryKey from(java.lang.Class<T> clazz)
Creates aCodecRegistryKey
for the specified class without any type arguments.- Type Parameters:
T
- The type of the base class.- Parameters:
clazz
- The base class of the codec.- Returns:
- A new
CodecRegistryKey
instance.
-
from
public static <T> CodecRegistryKey from(java.lang.Class<T> clazz, java.lang.reflect.Type[] typeArgs)
Creates aCodecRegistryKey
for the specified class and type arguments.- Type Parameters:
T
- The type of the base class.- Parameters:
clazz
- The base class of the codec.typeArgs
- The type arguments for generic types.- Returns:
- A new
CodecRegistryKey
instance.
-
equals
public boolean equals(java.lang.Object other)
Compares this key with another object for equality based on the base class and type arguments.- Overrides:
equals
in classjava.lang.Object
- Parameters:
other
- The object to compare with this key.- Returns:
true
if the other object is aCodecRegistryKey
with the same base class and type arguments;false
otherwise.
-
hashCode
public final int hashCode()
Returns a hash code for this key, based on the base class and type arguments.- Overrides:
hashCode
in classjava.lang.Object
- Returns:
- The hash code for this
CodecRegistryKey
.
-
-