Class EitherCodecResolver
java.lang.Object
dev.scsupercraft.mc.libraries.corelib.serialization.resolver.unique.EitherCodecResolver
- All Implemented Interfaces:
CodecResolver
A codec resolver for
Eithers.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<T> @NotNull CodecHolder<T> resolveCodec(GenericClass<T> genericClass) Resolves a codec for the provided generic class.booleansupportsValue(GenericClass<?> genericClass) Is the generic class supported by this codec resolver?
-
Constructor Details
-
EitherCodecResolver
public EitherCodecResolver()Creates a newEitherCodecResolver.
-
-
Method Details
-
supportsValue
Description copied from interface:CodecResolverIs the generic class supported by this codec resolver?- Specified by:
supportsValuein interfaceCodecResolver- Parameters:
genericClass- The generic class.- Returns:
- Is the generic class supported?
-
resolveCodec
Description copied from interface:CodecResolverResolves a codec for the provided generic class.Called only if
CodecResolver.supportsValue(GenericClass)returned true.- Specified by:
resolveCodecin interfaceCodecResolver- Type Parameters:
T- The type of class contained in the generic class.- Parameters:
genericClass- The generic class.- Returns:
- A codec holder containing the codecs for the provided generic class.
-