Package devs.beer.nativepackets.api
Record Class PacketSendResult
java.lang.Object
java.lang.Record
devs.beer.nativepackets.api.PacketSendResult
Immutable result of one tracked outbound write.
-
Constructor Summary
ConstructorsConstructorDescriptionPacketSendResult(PacketSendOutcome outcome, Throwable failure) Creates an instance of aPacketSendResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionstatic PacketSendResultaborted()Returns lifecycle cleanup before transport completion.static PacketSendResultReturns a listener-cancelled no-write outcome.final booleanIndicates whether some other object is "equal to" this one.static PacketSendResultReturns a failed dispatch or actual write.failure()Returns the value of thefailurerecord component.final inthashCode()Returns a hash code value for this object.outcome()Returns the value of theoutcomerecord component.static PacketSendResultsuccess()Returns a successful actual write.booleanReports actual successful downstream completion.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PacketSendResult
Creates an instance of aPacketSendResultrecord class.- Parameters:
outcome- the value for theoutcomerecord componentfailure- the value for thefailurerecord component
-
-
Method Details
-
success
Returns a successful actual write. -
cancelled
Returns a listener-cancelled no-write outcome. -
failed
Returns a failed dispatch or actual write. -
aborted
Returns lifecycle cleanup before transport completion. -
successful
public boolean successful()Reports actual successful downstream completion. -
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). -
outcome
Returns the value of theoutcomerecord component.- Returns:
- the value of the
outcomerecord component
-
failure
Returns the value of thefailurerecord component.- Returns:
- the value of the
failurerecord component
-