com.fasterxml.clustermate.client.call.CallResult Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of clustermate-client Show documentation
Show all versions of clustermate-client Show documentation
Building blocks for client libraries that access
ClusterMate-based service.
package com.fasterxml.clustermate.client.call;
import com.fasterxml.clustermate.client.CallFailure;
public abstract class CallResult
{
protected final int _status;
protected final CallFailure _fail;
protected CallResult(int statusCode) {
this(statusCode, null);
}
protected CallResult(CallFailure fail) {
this(fail.getStatusCode(), fail);
}
protected CallResult(int statusCode, CallFailure fail)
{
_status = statusCode;
_fail = fail;
}
/*
/**********************************************************************
/* Public API
/**********************************************************************
*/
public int getStatus() { return _status; }
public abstract String getHeaderValue(String key);
public boolean failed() { return _fail != null; }
public boolean succeeded() { return !failed(); }
public CallFailure getFailure() { return _fail; }
}