com.vaadin.copilot.communication.
Record Class StreamResponse
StreamResponse is a record class used for sending responses to the client when the '/stream' endpoint is accessed.
These responses are sent as JSON objects and include a status, message, exception, and any modified file changes.
The status is represented by an enum, which helps determine and convey the response's status on the client side (see StreamResponseEnum
} for more details).
More information about the endpoint can be found in the com.vaadin.copilot.communication.Router
.
Additional details on the configuration for the streaming endpoint are available in the com.vaadin.copilot.communication.SecurityConfig
class.
-
Constructor Summary
ConstructorsConstructorDescriptionStreamResponse
(StreamResponseEnum status, String message, String exception, Map<String, String> changes, int code) Creates an instance of a
StreamResponse
record class. -
Method Summary
Modifier and TypeMethodDescriptionchanges()
Returns the value of the
changes
record component.int
code()
Returns the value of the
code
record component.final boolean
Indicates whether some other object is "equal to" this one.
Returns the value of the
exception
record component.final int
hashCode()
Returns a hash code value for this object.
message()
Returns the value of the
message
record component.status()
Returns the value of the
status
record component.final String
toString()
Returns a string representation of this record class.
-
Constructor Details
-
StreamResponse
public StreamResponse(StreamResponseEnum status, String message, String exception, Map<String, String> changes, int code) Creates an instance of a
StreamResponse
record class.Parameters:
status
- the value for thestatus
record componentmessage
- the value for themessage
record componentexception
- the value for theexception
record componentchanges
- the value for thechanges
record componentcode
- the value for thecode
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. Reference components are compared with
Objects::equals(Object,Object)
; primitive components are compared with '=='. -
status
Returns the value of the
status
record component.Returns:
the value of the
status
record component -
message
Returns the value of the
message
record component.Returns:
the value of the
message
record component -
exception
Returns the value of the
exception
record component.Returns:
the value of the
exception
record component -
changes
Returns the value of the
changes
record component.Returns:
the value of the
changes
record component -
code
public int code()Returns the value of the
code
record component.Returns:
the value of the
code
record component
-