Android Open Source - Webby Webby Response






From Project

Back to project page Webby.

License

The source code is released under:

MIT License

If you think the Android project Webby listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.swampmobile.webby.requests;
//from   w  ww .  j av  a  2 s .  c  o  m
import android.net.Uri;

import com.google.gson.JsonElement;

/**
 * Represents the result of REST communication.
 */
public class WebbyResponse
{
    private Uri resourceId;
    private int statusCode;
    private String statusPhrase;
    private JsonElement response;
    private boolean isFromCache;
    private Exception error;

    public WebbyResponse(Uri resourceId, int statusCode, String statusPhrase, JsonElement response, Exception error)
    {
        this(resourceId, statusCode, statusPhrase, response, false);
        this.error = error;
    }

    public WebbyResponse(Uri resourceId, int statusCode, String statusPhrase, JsonElement response, boolean isFromCache)
    {
        this.resourceId = resourceId;
        this.statusCode = statusCode;
        this.statusPhrase = statusPhrase;
        this.response = response;
        this.isFromCache = isFromCache;
    }

    public Uri getResourceId()
    {
        return resourceId;
    }

    public int getResponseStatusCode()
    {
        return statusCode;
    }

    public String getResponseStatusPhrase()
    {
        return statusPhrase;
    }

    public JsonElement getResponse()
    {
        return response;
    }

    public boolean isFromCache()
    {
        return isFromCache;
    }

    public boolean wasRequestSuccessful()
    {
        return error == null;
    }

    public Exception getError()
    {
        return error;
    }
}




Java Source Code List

com.swampmobile.webby.WebbyManager.java
com.swampmobile.webby.Webby.java
com.swampmobile.webby.examples.activities.MainActivity.java
com.swampmobile.webby.examples.activities.WebbyActivity.java
com.swampmobile.webby.examples.activities.WebbyFragmentActivity.java
com.swampmobile.webby.examples.apis.FeedzillaApi.java
com.swampmobile.webby.examples.fragments.WebbyFragment.java
com.swampmobile.webby.examples.requests.TestWebbyRequest.java
com.swampmobile.webby.requests.WebbyRequest.java
com.swampmobile.webby.requests.WebbyResponse.java
com.swampmobile.webby.services.WebbyService.java
com.swampmobile.webby.util.cache.DataCache.java
com.swampmobile.webby.util.cache.FlatFileDataCache.java
com.swampmobile.webby.util.logging.WebbyLog.java
com.swampmobile.webby.util.time.Duration.java