V
- value typepublic abstract class Receiver<V>
extends java.lang.Object
Request.fire(Receiver)
and
RequestContext.fire(Receiver)
.Constructor and Description |
---|
Receiver() |
Modifier and Type | Method and Description |
---|---|
void |
onConstraintViolation(java.util.Set<ConstraintViolation<?>> violations)
Called if an object sent to the server could not be validated.
|
void |
onFailure(ServerFailure error)
Receives general failure notifications.
|
abstract void |
onSuccess(V response)
Called when a Request has been successfully executed on the server.
|
void |
onViolation(java.util.Set<Violation> errors)
Deprecated.
Use
onConstraintViolation(Set) instead |
public void onFailure(ServerFailure error)
ServerFailure.isFatal()
, and throws a runtime exception with the
failure object's error message if it is true.error
- a ServerFailure
instancepublic abstract void onSuccess(V response)
response
- a response of type V@Deprecated public void onViolation(java.util.Set<Violation> errors)
onConstraintViolation(Set)
insteadonFailure(ServerFailure)
if errors
is not empty.errors
- a Set of Violation
instancespublic void onConstraintViolation(java.util.Set<ConstraintViolation<?>> violations)
onViolation(Set)
, converting the
ConstraintViolation
objects to the deprecated Violation
type.violations
- a Set of ConstraintViolation
instances