Package com.vaadin.flow.server.streams
Record Class UploadResult
java.lang.Object
java.lang.Record
com.vaadin.flow.server.streams.UploadResult
- Record Components:
success-trueif the upload was successful,falseotherwiseresponse- the response object for the upload requestexception- the exception that caused the failure, ornullif successful or no exception available
- All Implemented Interfaces:
Serializable
public record UploadResult(boolean success, VaadinResponse response, Exception exception)
extends Record
implements Serializable
Represents the result of an upload operation.
This record encapsulates the outcome of processing an upload request, including whether it was successful, the response object, and any exception that may have occurred.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionUploadResult(boolean success, VaadinResponse response) Creates an upload result without an exception.UploadResult(boolean success, VaadinResponse response, Exception exception) Creates an instance of aUploadResultrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theexceptionrecord component.final inthashCode()Returns a hash code value for this object.response()Returns the value of theresponserecord component.booleansuccess()Returns the value of thesuccessrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
UploadResult
Creates an upload result without an exception.- Parameters:
success-trueif the upload was successful,falseotherwiseresponse- the response object for the upload request
-
UploadResult
Creates an instance of aUploadResultrecord class.
-
-
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 withObjects::equals(Object,Object); primitive components are compared with '=='. -
success
public boolean success()Returns the value of thesuccessrecord component.- Returns:
- the value of the
successrecord component
-
response
Returns the value of theresponserecord component.- Returns:
- the value of the
responserecord component
-
exception
Returns the value of theexceptionrecord component.- Returns:
- the value of the
exceptionrecord component
-