All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.fasterxml.storemate.client.call.CallResult Maven / Gradle / Ivy

There is a newer version: 0.8.8
Show newest version
package com.fasterxml.storemate.client.call;

import com.fasterxml.storemate.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; }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy