- Enclosing interface:
Codec<T extends @UnknownNullability Object>
public static sealed interface Codec.RawValue
A raw value wrapper for entry is an object combined with its current decoder.
Allows converting of an intermediary object of a transcoder into the requested transcoder.
Useful when dealing with objects that have the same type required as their transcoder for example NBT and JSON.
Useful when dealing with objects that have the same type required as their transcoder for example NBT and JSON.
-
Method Summary
Modifier and TypeMethodDescription<D> Result
<D> convertTo
(Transcoder<D> coder) Converts the current value into another transcoderstatic <D> Codec.RawValue
of
(Transcoder<D> coder, D value) Creates a RawValue instance
-
Method Details
-
of
Creates a RawValue instance- Type Parameters:
D
- The Object type- Parameters:
coder
- the transcodervalue
- the value- Returns:
- the new raw value instance
-
convertTo
Converts the current value into another transcoder- Type Parameters:
D
- the resultant type; transcoder type.- Parameters:
coder
- the transcoder to convert the object into- Returns:
- the
Result
of converting tocoder
.
-