package tv.ouya.console.api;

import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import org.json.JSONException;
import org.json.JSONObject;

public class CreditCardInfo
  implements Parcelable
{
  public static final Parcelable.Creator<CreditCardInfo> CREATOR = new Parcelable.Creator()
  {
    public CreditCardInfo createFromParcel(Parcel paramAnonymousParcel)
    {
      return new CreditCardInfo(paramAnonymousParcel.readDouble(), paramAnonymousParcel.readString(), paramAnonymousParcel.readString(), paramAnonymousParcel.readString(), paramAnonymousParcel.readString());
    }
    
    public CreditCardInfo[] newArray(int paramAnonymousInt)
    {
      return new CreditCardInfo[paramAnonymousInt];
    }
  };
  private double balance;
  private String currencyCode;
  private String expiresAt;
  private String lastFourDigits;
  private String provider;
  
  public CreditCardInfo() {}
  
  public CreditCardInfo(double paramDouble, String paramString1, String paramString2, String paramString3, String paramString4)
  {
    this.balance = paramDouble;
    this.lastFourDigits = paramString1;
    this.provider = paramString2;
    this.expiresAt = paramString3;
    this.currencyCode = paramString4;
  }
  
  public CreditCardInfo(JSONObject paramJSONObject)
    throws JSONException
  {
    readFromJSONObject(paramJSONObject);
  }
  
  private void readFromJSONObject(JSONObject paramJSONObject)
    throws JSONException
  {
    this.balance = paramJSONObject.optDouble("balance");
    this.currencyCode = paramJSONObject.optString("currency");
    if (paramJSONObject.isNull("credit_card"))
    {
      this.expiresAt = null;
      this.provider = null;
      this.lastFourDigits = null;
      return;
    }
    paramJSONObject = paramJSONObject.getJSONObject("credit_card");
    this.lastFourDigits = paramJSONObject.optString("last_four");
    this.provider = paramJSONObject.optString("provider");
    this.expiresAt = paramJSONObject.optString("expires_at");
  }
  
  public int describeContents()
  {
    return 0;
  }
  
  public boolean equals(Object paramObject)
  {
    if (this == paramObject) {}
    do
    {
      return true;
      if (!(paramObject instanceof CreditCardInfo)) {
        return false;
      }
      paramObject = (CreditCardInfo)paramObject;
      if (this.balance != ((CreditCardInfo)paramObject).balance) {
        return false;
      }
      if (!this.lastFourDigits.equals(((CreditCardInfo)paramObject).lastFourDigits)) {
        return false;
      }
      if (!this.provider.equals(((CreditCardInfo)paramObject).provider)) {
        return false;
      }
      if (!this.expiresAt.equals(((CreditCardInfo)paramObject).expiresAt)) {
        return false;
      }
    } while (this.currencyCode.equals(((CreditCardInfo)paramObject).currencyCode));
    return false;
  }
  
  public double getBalance()
  {
    return this.balance;
  }
  
  public String getCurrencyCode()
  {
    return this.currencyCode;
  }
  
  public String getExpiresAt()
  {
    return this.expiresAt;
  }
  
  public String getLastFourDigits()
  {
    return this.lastFourDigits;
  }
  
  public String getProvider()
  {
    return this.provider;
  }
  
  public int hashCode()
  {
    int j = Double.valueOf(this.balance).hashCode();
    int i = j;
    if (this.lastFourDigits != null) {
      i = j * 31 + this.lastFourDigits.hashCode();
    }
    j = i;
    if (this.provider != null) {
      j = i * 31 + this.provider.hashCode();
    }
    i = j;
    if (this.expiresAt != null) {
      i = j * 31 + this.expiresAt.hashCode();
    }
    j = i;
    if (this.currencyCode != null) {
      j = i * 31 + this.currencyCode.hashCode();
    }
    return j;
  }
  
  public void writeToParcel(Parcel paramParcel, int paramInt)
  {
    paramParcel.writeDouble(this.balance);
    paramParcel.writeString(this.lastFourDigits);
    paramParcel.writeString(this.provider);
    paramParcel.writeString(this.expiresAt);
    paramParcel.writeString(this.currencyCode);
  }
}


/* Location:              /home/enzo/Documents/hacking/malwares/viking-horde/classes.jar!/tv/ouya/console/api/CreditCardInfo.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */