package tv.ouya.console.api;

import android.os.Parcel;
import android.os.Parcelable;
import android.os.Parcelable.Creator;
import java.text.DecimalFormat;
import java.text.NumberFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Currency;
import java.util.Date;
import java.util.TimeZone;

public class Receipt
  implements Parcelable
{
  public static final Parcelable.Creator<Receipt> CREATOR = new Parcelable.Creator()
  {
    public Receipt createFromParcel(Parcel paramAnonymousParcel)
    {
      return new Receipt(paramAnonymousParcel.readString(), paramAnonymousParcel.readInt(), new Date(paramAnonymousParcel.readLong()), new Date(paramAnonymousParcel.readLong()), paramAnonymousParcel.readString(), paramAnonymousParcel.readString(), paramAnonymousParcel.readDouble(), paramAnonymousParcel.readString());
    }
    
    public Receipt[] newArray(int paramAnonymousInt)
    {
      return new Receipt[paramAnonymousInt];
    }
  };
  private static final SimpleDateFormat DATE_PARSER = new SimpleDateFormat("yyy-MM-dd'T'HH:mm:ss'Z'");
  private String currency;
  private String gamer;
  private Date generatedDate;
  private String identifier;
  private double localPrice;
  private int priceInCents;
  private Date purchaseDate;
  private String uuid;
  
  static
  {
    DATE_PARSER.setTimeZone(TimeZone.getTimeZone("UTC"));
  }
  
  public Receipt() {}
  
  public Receipt(String paramString1, int paramInt, Date paramDate1, Date paramDate2, String paramString2, String paramString3, double paramDouble, String paramString4)
  {
    this.identifier = paramString1;
    this.priceInCents = paramInt;
    this.purchaseDate = paramDate1;
    this.generatedDate = paramDate2;
    this.gamer = paramString2;
    this.uuid = paramString3;
    this.localPrice = paramDouble;
    this.currency = paramString4;
  }
  
  public int describeContents()
  {
    return 0;
  }
  
  public boolean equals(Object paramObject)
  {
    if (this == paramObject) {}
    do
    {
      return true;
      if (!(paramObject instanceof Receipt)) {
        return false;
      }
      paramObject = (Receipt)paramObject;
      if (!this.identifier.equals(((Receipt)paramObject).identifier)) {
        return false;
      }
      if (this.priceInCents != ((Receipt)paramObject).priceInCents) {
        return false;
      }
      if (!this.purchaseDate.equals(((Receipt)paramObject).purchaseDate)) {
        return false;
      }
      if (!this.gamer.equals(((Receipt)paramObject).gamer)) {
        return false;
      }
      if (!this.uuid.equals(((Receipt)paramObject).uuid)) {
        return false;
      }
      if (this.localPrice != ((Receipt)paramObject).localPrice) {
        return false;
      }
    } while ((this.currency == null) || (this.currency.equals(((Receipt)paramObject).currency)));
    return false;
  }
  
  public String getCurrency()
  {
    return this.currency;
  }
  
  public String getFormattedPrice()
  {
    DecimalFormat localDecimalFormat;
    if ((this.currency != null) && (!this.currency.isEmpty()))
    {
      localDecimalFormat = (DecimalFormat)NumberFormat.getCurrencyInstance();
      localDecimalFormat.setCurrency(Currency.getInstance(this.currency));
    }
    for (;;)
    {
      return localDecimalFormat.format(this.localPrice);
      localDecimalFormat = new DecimalFormat("#.00");
    }
  }
  
  public String getGamer()
  {
    return this.gamer;
  }
  
  public Date getGeneratedDate()
  {
    return this.generatedDate;
  }
  
  public String getIdentifier()
  {
    return this.identifier;
  }
  
  public double getLocalPrice()
  {
    return this.localPrice;
  }
  
  @Deprecated
  public int getPriceInCents()
  {
    return this.priceInCents;
  }
  
  public Date getPurchaseDate()
  {
    return this.purchaseDate;
  }
  
  public String getUuid()
  {
    return this.uuid;
  }
  
  public int hashCode()
  {
    int j = ((((this.identifier.hashCode() * 31 + this.priceInCents) * 31 + this.purchaseDate.hashCode()) * 31 + this.gamer.hashCode()) * 31 + this.uuid.hashCode()) * 31 + new Double(this.localPrice).hashCode();
    int i = j;
    if (this.currency != null) {
      i = j * 31 + this.currency.hashCode();
    }
    return i;
  }
  
  public void setDate(String paramString)
  {
    try
    {
      setPurchaseDate(DATE_PARSER.parse(paramString));
      return;
    }
    catch (ParseException paramString)
    {
      throw new RuntimeException(paramString);
    }
  }
  
  public void setIdentifier(String paramString)
  {
    this.identifier = paramString;
  }
  
  public void setPriceInCents(int paramInt)
  {
    this.priceInCents = paramInt;
  }
  
  public void setPurchaseDate(Date paramDate)
  {
    this.purchaseDate = paramDate;
  }
  
  public void writeToParcel(Parcel paramParcel, int paramInt)
  {
    paramParcel.writeString(this.identifier);
    paramParcel.writeInt(this.priceInCents);
    paramParcel.writeLong(this.purchaseDate.getTime());
    paramParcel.writeLong(this.generatedDate.getTime());
    paramParcel.writeString(this.gamer);
    paramParcel.writeString(this.uuid);
    paramParcel.writeDouble(this.localPrice);
    paramParcel.writeString(this.currency);
  }
}


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