package com.huawei.hms.support.api.account; import android.text.TextUtils; import org.json.JSONException; import org.json.JSONObject; /* loaded from: classes2.dex */ public class AccountGetTokenOptions { private String a; private boolean b; public AccountGetTokenOptions(String str, boolean z) { this.a = str; this.b = z; } public JSONObject toJsonObject() throws JSONException { JSONObject jSONObject = new JSONObject(); if (!TextUtils.isEmpty(this.a)) { jSONObject.put("accountName", this.a); } jSONObject.put("fromGetToken", this.b); return jSONObject; } public static AccountGetTokenOptions fromJsonObject(JSONObject jSONObject) throws JSONException { return new AccountGetTokenOptions(jSONObject.optString("accountName"), jSONObject.optBoolean("fromGetToken", false)); } public void setFromGetToken(boolean z) { this.b = z; } public void setAccountName(String str) { this.a = str; } public boolean isFromGetToken() { return this.b; } public String getAccountName() { return this.a; } }