Codec.ResultFunction<A>
Decoder.Boxed<A>, Decoder.Simple<A>, Decoder.Terminal<A>
BOOL, BYTE, BYTE_BUFFER, DOUBLE, EMPTY, FLOAT, INT, INT_STREAM, LONG, LONG_STREAM, PASSTHROUGH, SHORT, STRING
Constructor and Description |
---|
EitherCodec(Codec<F> first,
Codec<S> second) |
Modifier and Type | Method and Description |
---|---|
<T> DataResult<((F|S),T)> |
decode(DynamicOps<T> ops,
T input)
Decodes an object from the specified serialized data.
|
<T> DataResult<T> |
encode((F|S) input,
DynamicOps<T> ops,
T prefix)
Encodes an object into the specified serialized data.
|
boolean |
equals(Object o) |
int |
hashCode() |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
checkRange, comapFlatMap, compoundList, deprecated, dispatch, dispatch, dispatchMap, dispatchMap, dispatchStable, doubleRange, either, fieldOf, flatComapMap, flatXmap, floatRange, intRange, list, listOf, mapEither, mapPair, mapResult, of, of, of, of, optionalField, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, pair, partialDispatch, promotePartial, simpleMap, stable, unboundedMap, unit, unit, withLifecycle, xmap
public <T> DataResult<((F|S),T)> decode(DynamicOps<T> ops, T input)
Decoder
DataResult
.decode
in interface Decoder<(F|S)>
T
- The type of the serialized form.ops
- The DynamicOps
instance defining the serialized form.input
- The serialized data.Pair
containing the decoded object and the remaining serialized data, wrapped in a DataResult
.public <T> DataResult<T> encode((F|S) input, DynamicOps<T> ops, T prefix)
Encoder
DataResult
.encode
in interface Encoder<(F|S)>
T
- The type of the serialized form.input
- The object to serialize.ops
- The DynamicOps
instance defining the serialized form.prefix
- The existing serialized data to append to.DataResult
wrapping the serialized form of input
, appended to prefix
.