Record Class ProtocolHandshake.Result
java.lang.Object
java.lang.Record
com.loomcache.client.ProtocolHandshake.Result
- Record Components:
peerVersion- the peer's semantic versionnegotiatedProtocolVersion- the negotiated wire protocol versionpeerFeatureBitmap- the peer's advertised feature bitmap
- Enclosing class:
ProtocolHandshake
public static record ProtocolHandshake.Result(LoomVersion peerVersion, int negotiatedProtocolVersion, long peerFeatureBitmap)
extends Record
Outcome of a successful handshake.
peerFeatureBitmap may contain
bits this build does not recognize (newer peer) — decode via
ProtocolFeatures.fromBitmap(long).-
Constructor Summary
ConstructorsConstructorDescriptionResult(LoomVersion peerVersion, int negotiatedProtocolVersion, long peerFeatureBitmap) Creates an instance of aResultrecord 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.intReturns the value of thenegotiatedProtocolVersionrecord component.longReturns the value of thepeerFeatureBitmaprecord component.Returns the value of thepeerVersionrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Result
Creates an instance of aResultrecord class.- Parameters:
peerVersion- the value for thepeerVersionrecord componentnegotiatedProtocolVersion- the value for thenegotiatedProtocolVersionrecord componentpeerFeatureBitmap- the value for thepeerFeatureBitmaprecord component
-
-
Method Details
-
peerFeatures
- Returns:
- the peer's feature set decoded to known enum values
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with thecomparemethod from their corresponding wrapper classes. -
peerVersion
Returns the value of thepeerVersionrecord component.- Returns:
- the value of the
peerVersionrecord component
-
negotiatedProtocolVersion
public int negotiatedProtocolVersion()Returns the value of thenegotiatedProtocolVersionrecord component.- Returns:
- the value of the
negotiatedProtocolVersionrecord component
-
peerFeatureBitmap
public long peerFeatureBitmap()Returns the value of thepeerFeatureBitmaprecord component.- Returns:
- the value of the
peerFeatureBitmaprecord component
-