Interface Codec.Encoder<T>
- Type Parameters:
T- The target Java type.
public static interface Codec.Encoder<T>
Functional interface defining the encoding logic of a codec.
-
Method Summary
Modifier and TypeMethodDescription<D> DataResult<D> encode(DynamicOps<D> ops, T value) Encodes the Java object.
-
Method Details
-
encode
Encodes the Java object.- Type Parameters:
D- The serialized data type.- Parameters:
ops- The dynamic operations instance.value- The value to encode.- Returns:
- The encoded result.
-