Record Class ListCodec<E>
java.lang.Object
java.lang.Record
com.mojang.serialization.codecs.ListCodec<E>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface Codec
Codec.RecursiveCodec<T>, Codec.ResultFunction<A>Nested classes/interfaces inherited from interface Decoder
Decoder.Boxed<A>, Decoder.Simple<A>, Decoder.Terminal<A> -
Field Summary
FieldsModifier and TypeFieldDescriptionThe field for theelementCodecrecord component.private final intThe field for themaxSizerecord component.private final intThe field for theminSizerecord component.Fields inherited from interface Codec
BOOL, BYTE, BYTE_BUFFER, DOUBLE, EMPTY, FLOAT, INT, INT_STREAM, LONG, LONG_STREAM, PASSTHROUGH, SHORT, STRING -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate <R> DataResult<R> createTooLongError(int size) private <R> DataResult<R> createTooShortError(int size) <T> DataResult<Pair<List<E>, T>> decode(DynamicOps<T> ops, T input) Returns the value of theelementCodecrecord component.<T> DataResult<T> encode(List<E> input, DynamicOps<T> ops, T prefix) final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.intmaxSize()Returns the value of themaxSizerecord component.intminSize()Returns the value of theminSizerecord component.toString()Returns a string representation of this record class.Methods inherited from interface Codec
comapFlatMap, deprecated, dispatch, dispatch, dispatchMap, dispatchMap, dispatchStable, fieldOf, flatComapMap, flatXmap, lenientOptionalFieldOf, lenientOptionalFieldOf, lenientOptionalFieldOf, lenientOptionalFieldOf, listOf, listOf, mapResult, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, partialDispatch, promotePartial, sizeLimitedListOf, stable, validate, withAlternative, withAlternative, withLifecycle, xmapMethods inherited from interface Decoder
boxed, decode, flatMap, map, parse, parse, simple, terminalMethods inherited from interface Encoder
comap, encodeStart, flatComap
-
Field Details
-
elementCodec
-
minSize
private final int minSizeThe field for theminSizerecord component. -
maxSize
private final int maxSizeThe field for themaxSizerecord component.
-
-
Constructor Details
-
ListCodec
-
-
Method Details
-
createTooShortError
-
createTooLongError
-
encode
-
decode
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
elementCodec
-
minSize
public int minSize()Returns the value of theminSizerecord component.- Returns:
- the value of the
minSizerecord component
-
maxSize
public int maxSize()Returns the value of themaxSizerecord component.- Returns:
- the value of the
maxSizerecord component
-