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

com.tapstream.sdk.wordofmouth.DelegatedJSONObject Maven / Gradle / Ivy

There is a newer version: 4.0.0
Show newest version
package com.tapstream.sdk.wordofmouth;

import org.json.JSONException;
import org.json.JSONObject;

class DelegatedJSONObject {
    protected final JSONObject delegate;

    protected DelegatedJSONObject(JSONObject delegate){
        this.delegate = delegate;
    }

    protected String getOrDefault(String key, String d){
        try {
            return delegate.getString(key);
        }catch(JSONException e){
            return d;
        }
    }

    protected int getOrDefault(String key, int d){
        try {
            return delegate.getInt(key);
        }catch(JSONException e){
            return d;
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy