Record Class PacketReading.Result.Failure<T>
java.lang.Object
java.lang.Record
net.minestom.server.network.packet.PacketReading.Result.Failure<T>
- All Implemented Interfaces:
PacketReading.Result<T>
- Enclosing interface:
PacketReading.Result<T>
public static record PacketReading.Result.Failure<T>(long requiredCapacity)
extends Record
implements PacketReading.Result<T>
Represents a failure to read a packet due to insufficient buffer capacity.
Buffer should be expanded to at least requiredCapacity bytes.
If the buffer does not allow to read the packet length, max var-int length is returned.
-
Nested Class Summary
Nested classes/interfaces inherited from interface PacketReading.Result
PacketReading.Result.Empty<T>, PacketReading.Result.Failure<T>, PacketReading.Result.Success<T> -
Constructor Summary
ConstructorsConstructorDescriptionFailure(long requiredCapacity) Creates an instance of aFailurerecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.longReturns the value of therequiredCapacityrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Failure
public Failure(long requiredCapacity) Creates an instance of aFailurerecord class.- Parameters:
requiredCapacity- the value for therequiredCapacityrecord component
-
-
Method Details
-
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. All components in this record class are compared with thecomparemethod from their corresponding wrapper classes. -
requiredCapacity
public long requiredCapacity()Returns the value of therequiredCapacityrecord component.- Returns:
- the value of the
requiredCapacityrecord component
-