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 net.minestom.server.network.packet.PacketReading.Result
PacketReading.Result.Empty<T>, PacketReading.Result.Failure<T>, PacketReading.Result.Success<T>
-
Constructor Summary
ConstructorDescriptionFailure
(long requiredCapacity) Creates an instance of aFailure
record class. -
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
Indicates whether some other object is "equal to" this one.final int
hashCode()
Returns a hash code value for this object.long
Returns the value of therequiredCapacity
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
Failure
public Failure(long requiredCapacity) Creates an instance of aFailure
record class.- Parameters:
requiredCapacity
- the value for therequiredCapacity
record component
-
-
Method Details
-
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 with '=='. -
requiredCapacity
public long requiredCapacity()Returns the value of therequiredCapacity
record component.- Returns:
- the value of the
requiredCapacity
record component
-