73 lines
1.8 KiB
Java
73 lines
1.8 KiB
Java
package com.android.billingclient.api;
|
|
|
|
import android.text.TextUtils;
|
|
import androidx.annotation.NonNull;
|
|
import androidx.annotation.Nullable;
|
|
import org.json.JSONException;
|
|
import org.json.JSONObject;
|
|
/* compiled from: com.android.billingclient:billing@@3.0.3 */
|
|
public class SkuDetails {
|
|
public final String a;
|
|
public final JSONObject b;
|
|
|
|
public SkuDetails(@NonNull String str) throws JSONException {
|
|
this.a = str;
|
|
JSONObject jSONObject = new JSONObject(str);
|
|
this.b = jSONObject;
|
|
if (TextUtils.isEmpty(jSONObject.optString("productId"))) {
|
|
throw new IllegalArgumentException("SKU cannot be empty.");
|
|
} else if (TextUtils.isEmpty(jSONObject.optString("type"))) {
|
|
throw new IllegalArgumentException("SkuType cannot be empty.");
|
|
}
|
|
}
|
|
|
|
@NonNull
|
|
public String a() {
|
|
return this.b.optString("description");
|
|
}
|
|
|
|
@NonNull
|
|
public String b() {
|
|
return this.b.optString("price");
|
|
}
|
|
|
|
public long c() {
|
|
return this.b.optLong("price_amount_micros");
|
|
}
|
|
|
|
@NonNull
|
|
public String d() {
|
|
return this.b.optString("productId");
|
|
}
|
|
|
|
@NonNull
|
|
public String e() {
|
|
return this.b.optString("type");
|
|
}
|
|
|
|
public boolean equals(@Nullable Object obj) {
|
|
if (this == obj) {
|
|
return true;
|
|
}
|
|
if (!(obj instanceof SkuDetails)) {
|
|
return false;
|
|
}
|
|
return TextUtils.equals(this.a, ((SkuDetails) obj).a);
|
|
}
|
|
|
|
@NonNull
|
|
public final String f() {
|
|
return this.b.optString("packageName");
|
|
}
|
|
|
|
public int hashCode() {
|
|
return this.a.hashCode();
|
|
}
|
|
|
|
@NonNull
|
|
public String toString() {
|
|
String valueOf = String.valueOf(this.a);
|
|
return valueOf.length() != 0 ? "SkuDetails: ".concat(valueOf) : new String("SkuDetails: ");
|
|
}
|
|
}
|