Advertisement
edgarairapetov

Untitled

Apr 7th, 2020
798
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.60 KB | None | 0 0
  1. public class SkuDetails {
  2.     private final String zza;
  3.     private final JSONObject zzb;
  4.  
  5.     public SkuDetails(String var1) throws JSONException {
  6.         this.zza = var1;
  7.         this.zzb = new JSONObject(this.zza);
  8.     }
  9.  
  10.     @NonNull
  11.     public String getOriginalJson() {
  12.         return this.zza;
  13.     }
  14.  
  15.     @NonNull
  16.     public String getSku() {
  17.         return this.zzb.optString("productId");
  18.     }
  19.  
  20.     @NonNull
  21.     public String getType() {
  22.         return this.zzb.optString("type");
  23.     }
  24.  
  25.     @NonNull
  26.     public String getPrice() {
  27.         return this.zzb.optString("price");
  28.     }
  29.  
  30.     public long getPriceAmountMicros() {
  31.         return this.zzb.optLong("price_amount_micros");
  32.     }
  33.  
  34.     @NonNull
  35.     public String getPriceCurrencyCode() {
  36.         return this.zzb.optString("price_currency_code");
  37.     }
  38.  
  39.     public String getOriginalPrice() {
  40.         return this.zzb.has("original_price") ? this.zzb.optString("original_price") : this.getPrice();
  41.     }
  42.  
  43.     public long getOriginalPriceAmountMicros() {
  44.         return this.zzb.has("original_price_micros") ? this.zzb.optLong("original_price_micros") : this.getPriceAmountMicros();
  45.     }
  46.  
  47.     @NonNull
  48.     public String getTitle() {
  49.         return this.zzb.optString("title");
  50.     }
  51.  
  52.     @NonNull
  53.     public String getDescription() {
  54.         return this.zzb.optString("description");
  55.     }
  56.  
  57.     public String getSubscriptionPeriod() {
  58.         return this.zzb.optString("subscriptionPeriod");
  59.     }
  60.  
  61.     public String getFreeTrialPeriod() {
  62.         return this.zzb.optString("freeTrialPeriod");
  63.     }
  64.  
  65.     public String getIntroductoryPrice() {
  66.         return this.zzb.optString("introductoryPrice");
  67.     }
  68.  
  69.     public long getIntroductoryPriceAmountMicros() {
  70.         return this.zzb.optLong("introductoryPriceAmountMicros");
  71.     }
  72.  
  73.     public String getIntroductoryPricePeriod() {
  74.         return this.zzb.optString("introductoryPricePeriod");
  75.     }
  76.  
  77.     public String getIntroductoryPriceCycles() {
  78.         return this.zzb.optString("introductoryPriceCycles");
  79.     }
  80.  
  81.     public String getIconUrl() {
  82.         return this.zzb.optString("iconUrl");
  83.     }
  84.  
  85.     public boolean isRewarded() {
  86.         return this.zzb.has("rewardToken");
  87.     }
  88.  
  89.     String getSkuDetailsToken() {
  90.         return this.zzb.optString("skuDetailsToken");
  91.     }
  92.  
  93.     String rewardToken() {
  94.         return this.zzb.optString("rewardToken");
  95.     }
  96.  
  97.     public String toString() {
  98.         String var10001 = String.valueOf(this.zza);
  99.         return var10001.length() != 0 ? "SkuDetails: ".concat(var10001) : new String("SkuDetails: ");
  100.     }
  101.  
  102.     public boolean equals(Object var1) {
  103.         if (this == var1) {
  104.             return true;
  105.         } else if (!(var1 instanceof SkuDetails)) {
  106.             return false;
  107.         } else {
  108.             SkuDetails var2 = (SkuDetails)var1;
  109.             return TextUtils.equals(this.zza, var2.zza);
  110.         }
  111.     }
  112.  
  113.     public int hashCode() {
  114.         return this.zza.hashCode();
  115.     }
  116.  
  117.     public static class SkuDetailsResult {
  118.         private List<SkuDetails> zza;
  119.         private final int zzb;
  120.         private final String zzc;
  121.  
  122.         public SkuDetailsResult(int var1, String var2, List<SkuDetails> var3) {
  123.             this.zzb = var1;
  124.             this.zzc = var2;
  125.             this.zza = var3;
  126.         }
  127.  
  128.         public List<SkuDetails> getSkuDetailsList() {
  129.             return this.zza;
  130.         }
  131.  
  132.         public int getResponseCode() {
  133.             return this.zzb;
  134.         }
  135.  
  136.         public String getDebugMessage() {
  137.             return this.zzc;
  138.         }
  139.     }
  140. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement