Record Class CopilotWebSocketMessage
java.lang.Object
java.lang.Record
com.github.copilot.CopilotWebSocketMessage
- Record Components:
data- the message payload bytesbinary-truefor a binary frame,falsefor a UTF-8 text frame
A single WebSocket message exchanged through a
CopilotWebSocketHandler hook.- Since:
- 1.0.0
-
Constructor Summary
ConstructorsConstructorDescriptionCopilotWebSocketMessage(byte[] data, boolean binary) Creates an instance of aCopilotWebSocketMessagerecord class. -
Method Summary
Modifier and TypeMethodDescriptionbooleanbinary()Returns the value of thebinaryrecord component.byte[]data()Returns the value of thedatarecord component.final booleanIndicates whether some other object is "equal to" this one.static CopilotWebSocketMessageCreates a text message from a UTF-8 string.final inthashCode()Returns a hash code value for this object.text()Decodes the payload as UTF-8 text.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
CopilotWebSocketMessage
-
-
Method Details
-
text
-
fromText
Creates a text message from a UTF-8 string.- Parameters:
text- the text payload- Returns:
- a text message
-
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. -
data
-
binary
-