users@jersey.java.net

Re: [Jersey] Successful response

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 01 Sep 2009 14:45:01 +0200

On Sep 1, 2009, at 11:18 AM, António Mota wrote:

> Wouldn't be a good idea to add methods to the ResponseImpl such as
>
> public boolean sucessfull(){
> int status = this.getStatus();
> Status statusCode = Status.fromStatusCode(status);
> if (statusCode!=null && statusCode.getFamily() !=
> Family.SUCCESSFUL) {
> return false;
> }
> return true;
> }
>
> or perhaps more general
>
> public boolean resulted(Family family){
> int status = this.getStatus();
> Status statusCode = Status.fromStatusCode(status);
> if (statusCode!=null && statusCode.getFamily() != family) {
> return false;
> }
> return true;
> }
>

Not sure, as this type is not likely to be consumed by the developer,
it is the Response type that will be consumed.

What would be a use-case? checking a Response with an ExceptionMapper?

Paul.