Android Open Source - MobileConnectTestApp Logo Cache Item






From Project

Back to project page MobileConnectTestApp.

License

The source code is released under:

MIT License

If you think the Android project MobileConnectTestApp 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.gsma.android.xoperatorapidemo.logo;
//from   w  w w  . j av a2s. co m
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;

import android.graphics.Bitmap;

public class LogoCacheItem {
  private static final String TAG="LogoCacheItem";
  
  public LogoResponse getLogo() {
    return logo;
  }
  public void setLogo(LogoResponse logo) {
    this.logo = logo;
  }
  public String getLocalFile() {
    return localFile;
  }
  public void setLocalFile(String localFile) {
    this.localFile = localFile;
  }
  public String getETag() {
    return eTag;
  }
  public void setETag(String eTag) {
    this.eTag = eTag;
  }
  public String getLastModified() {
    return lastModified;
  }
  public void setLastModified(String lastModified) {
    this.lastModified = lastModified;
  }
  LogoResponse logo;
  String localFile;
  String eTag;
  String lastModified;
  long lastModifiedTimestamp;
  
  public long getLastModifiedTimestamp() {
    return lastModifiedTimestamp;
  }
  public void setLastModifiedTimestamp(long lastModifiedTimestamp) {
    this.lastModifiedTimestamp = lastModifiedTimestamp;
  }
  Bitmap imageFile;
  
  public Bitmap getImageFile() {
    return imageFile;
  }
  public void setImageFile(Bitmap imageFile) {
    this.imageFile = imageFile;
  }
  public LogoCacheItem (JSONObject jsonObject) throws JSONException {
    if (jsonObject!=null) {
      this.localFile=jsonObject.getString("localFile");
      this.eTag=jsonObject.getString("eTag");
      this.lastModified=jsonObject.getString("lastModified");
      this.lastModifiedTimestamp=jsonObject.getLong("lastModifiedTimestamp");
      Object logo=jsonObject.get("logo");
      if (logo!=null) {
        this.logo=new LogoResponse(logo);
      }
    }
  }
  
  public LogoCacheItem() {
  }
  
  public static LogoCacheItem[] fromSerialisedArrayString(String logoCacheSerialised) throws JSONException {
    LogoCacheItem[] logoArray=null;
    JSONArray sa=new JSONArray(logoCacheSerialised);
    if (sa!=null) {
      logoArray=new LogoCacheItem[sa.length()];
      for (int i=0; i<sa.length(); i++) {
        JSONObject cur=sa.getJSONObject(i);
        logoArray[i]=new LogoCacheItem(cur);
      }
    }
    return logoArray;
  }
  
  public JSONObject toObject() throws JSONException {
    JSONObject obj=new JSONObject();
    
    if (eTag!=null) obj.put("eTag", eTag);
    if (localFile!=null) obj.put("localFile", localFile);
    if (lastModified!=null) obj.put("lastModified", lastModified);
    if (logo!=null) obj.put("logo", logo.toObject());
    obj.put("lastModifiedTimestamp", lastModifiedTimestamp);
    return obj;
  }


}




Java Source Code List

com.gsma.android.xoperatorapidemo.activity.MainActivity.java
com.gsma.android.xoperatorapidemo.activity.SettingsActivity.java
com.gsma.android.xoperatorapidemo.activity.discovery.ActiveDiscoveryTask.java
com.gsma.android.xoperatorapidemo.activity.discovery.DiscoveryProcessEndpoints.java
com.gsma.android.xoperatorapidemo.activity.discovery.DisplayDiscoveryWebsiteActivity.java
com.gsma.android.xoperatorapidemo.activity.discovery.PassiveDiscoveryTask.java
com.gsma.android.xoperatorapidemo.activity.discovery.ProcessDiscoveryToken.java
com.gsma.android.xoperatorapidemo.activity.identity.AuthorizationCompleteActivity.java
com.gsma.android.xoperatorapidemo.activity.identity.DisplayIdentityWebsiteActivity.java
com.gsma.android.xoperatorapidemo.activity.identity.OpenIDConnectAbstractActivity.java
com.gsma.android.xoperatorapidemo.activity.identity.RetrieveTokenTask.java
com.gsma.android.xoperatorapidemo.activity.identity.RetrieveUserinfoTask.java
com.gsma.android.xoperatorapidemo.discovery.Api.java
com.gsma.android.xoperatorapidemo.discovery.DeveloperOperatorSetting.java
com.gsma.android.xoperatorapidemo.discovery.DiscoveryData.java
com.gsma.android.xoperatorapidemo.discovery.DiscoveryDeveloperOperatorSettings.java
com.gsma.android.xoperatorapidemo.discovery.DiscoveryServingOperatorSettings.java
com.gsma.android.xoperatorapidemo.discovery.DiscoveryStartupSettings.java
com.gsma.android.xoperatorapidemo.discovery.LinkConstants.java
com.gsma.android.xoperatorapidemo.discovery.Link.java
com.gsma.android.xoperatorapidemo.discovery.Response.java
com.gsma.android.xoperatorapidemo.discovery.ServingOperatorSetting.java
com.gsma.android.xoperatorapidemo.identity.UserinfoAddress.java
com.gsma.android.xoperatorapidemo.identity.Userinfo.java
com.gsma.android.xoperatorapidemo.logo.LogoCacheItem.java
com.gsma.android.xoperatorapidemo.logo.LogoCache.java
com.gsma.android.xoperatorapidemo.logo.LogoLoaderTask.java
com.gsma.android.xoperatorapidemo.logo.LogoResponseArray.java
com.gsma.android.xoperatorapidemo.logo.LogoResponse.java
com.gsma.android.xoperatorapidemo.utils.HttpUtils.java
com.gsma.android.xoperatorapidemo.utils.JsonUtils.java
com.gsma.android.xoperatorapidemo.utils.KeyValuePair.java
com.gsma.android.xoperatorapidemo.utils.ParameterList.java
com.gsma.android.xoperatorapidemo.utils.PhoneState.java
com.gsma.android.xoperatorapidemo.utils.PhoneUtils.java
com.gsma.android.xoperatorapidemo.utils.PreferencesUtils.java