Package com.petrolpark.util
Record Class Neither.NeitherStreamCodec<B extends io.netty.buffer.ByteBuf,L,R>
java.lang.Object
java.lang.Record
com.petrolpark.util.Neither.NeitherStreamCodec<B,L,R>
- All Implemented Interfaces:
net.minecraft.network.codec.StreamCodec<B,,Neither<L, R>> net.minecraft.network.codec.StreamDecoder<B,,Neither<L, R>> net.minecraft.network.codec.StreamEncoder<B,Neither<L, R>>
public static record Neither.NeitherStreamCodec<B extends io.netty.buffer.ByteBuf,L,R> (net.minecraft.network.codec.StreamCodec<? super B extends io.netty.buffer.ByteBuf,L> leftCodec, net.minecraft.network.codec.StreamCodec<? super B extends io.netty.buffer.ByteBuf,R> rightCodec)
extends Record
implements net.minecraft.network.codec.StreamCodec<B,Neither<L,R>>
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.network.codec.StreamCodec
net.minecraft.network.codec.StreamCodec.CodecOperation<B,S, T> -
Constructor Summary
ConstructorsConstructorDescriptionNeitherStreamCodec(net.minecraft.network.codec.StreamCodec<? super B, L> leftCodec, net.minecraft.network.codec.StreamCodec<? super B, R> rightCodec) Creates an instance of aNeitherStreamCodecrecord class. -
Method Summary
Modifier and TypeMethodDescriptionvoidfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.Returns the value of theleftCodecrecord component.Returns the value of therightCodecrecord component.final StringtoString()Returns a string representation of this record class.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.network.codec.StreamCodec
apply, cast, dispatch, map, mapStream
-
Constructor Details
-
NeitherStreamCodec
public NeitherStreamCodec(net.minecraft.network.codec.StreamCodec<? super B, L> leftCodec, net.minecraft.network.codec.StreamCodec<? super B, R> rightCodec) Creates an instance of aNeitherStreamCodecrecord class.- Parameters:
leftCodec- the value for theleftCodecrecord componentrightCodec- the value for therightCodecrecord component
-
-
Method Details
-
decode
-
encode
-
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. All components in this record class are compared withObjects::equals(Object,Object). -
leftCodec
Returns the value of theleftCodecrecord component.- Returns:
- the value of the
leftCodecrecord component
-
rightCodec
Returns the value of therightCodecrecord component.- Returns:
- the value of the
rightCodecrecord component
-