Package dev.shamoo.runtime.core
Record Class OptionalProxyTransport.Response
java.lang.Object
java.lang.Record
dev.shamoo.runtime.core.OptionalProxyTransport.Response
- Enclosing class:
OptionalProxyTransport
public static record OptionalProxyTransport.Response(boolean available, byte[] payload, String error)
extends Record
Explicit distinction between an absent carrier/proxy, a canonical response frame, and a local transport error.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns the value of theavailablerecord component.available(byte[] payload) final booleanIndicates whether some other object is "equal to" this one.error()Returns the value of theerrorrecord component.final inthashCode()Returns a hash code value for this object.byte[]payload()Returns the value of thepayloadrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Response
Creates an instance of aResponserecord class.- Parameters:
available- the value for theavailablerecord componentpayload- the value for thepayloadrecord componenterror- the value for theerrorrecord component
-
-
Method Details
-
payload
public byte[] payload()Returns the value of thepayloadrecord component.- Returns:
- the value of the
payloadrecord component
-
available
-
error
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
available
public boolean available()Returns the value of theavailablerecord component.- Returns:
- the value of the
availablerecord component
-
error
Returns the value of theerrorrecord component.- Returns:
- the value of the
errorrecord component
-