You're viewing an older version of Vaadin JavaDoc. Please see version 24.7.0 for the latest.
com.vaadin.copilot.communication.

Record Class StreamResponse

java.lang.Object
java.lang.Record
com.vaadin.copilot.communication.StreamResponse
public record StreamResponse(StreamResponseEnum status, String message, String exception, Map<String,String> changes, int code) extends Record

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 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 the status record component

      message - the value for the message record component

      exception - the value for the exception record component

      changes - the value for the changes record component

      code - the value for the code record component

  • Method Details

    • toString

      public final String 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.

      Specified by:

      toString in class Record

      Returns:

      a string representation of this object

    • 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.

      Specified by:

      hashCode in class Record

      Returns:

      a hash code value for this object

    • equals

      public final boolean equals(Object o)

      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 '=='.

      Specified by:

      equals in class Record

      Parameters:

      o - the object with which to compare

      Returns:

      true if this object is the same as the o argument; false otherwise.

    • status

      public StreamResponseEnum status()

      Returns the value of the status record component.

      Returns:

      the value of the status record component

    • message

      public String message()

      Returns the value of the message record component.

      Returns:

      the value of the message record component

    • exception

      public String exception()

      Returns the value of the exception record component.

      Returns:

      the value of the exception record component

    • changes

      public Map<String,String> 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