|
|
|
@ -141,6 +141,7 @@ public class EntityAccount extends EntityOrder implements Serializable {
|
|
|
|
|
public JSONObject toJSON() throws JSONException {
|
|
|
|
|
JSONObject json = new JSONObject();
|
|
|
|
|
json.put("id", id);
|
|
|
|
|
json.put("order", order);
|
|
|
|
|
json.put("auth_type", auth_type);
|
|
|
|
|
json.put("host", host);
|
|
|
|
|
json.put("starttls", starttls);
|
|
|
|
@ -173,6 +174,10 @@ public class EntityAccount extends EntityOrder implements Serializable {
|
|
|
|
|
public static EntityAccount fromJSON(JSONObject json) throws JSONException {
|
|
|
|
|
EntityAccount account = new EntityAccount();
|
|
|
|
|
// id
|
|
|
|
|
|
|
|
|
|
if (json.has("order"))
|
|
|
|
|
account.order = json.getInt("order");
|
|
|
|
|
|
|
|
|
|
account.auth_type = json.getInt("auth_type");
|
|
|
|
|
account.host = json.getString("host");
|
|
|
|
|
account.starttls = (json.has("starttls") && json.getBoolean("starttls"));
|
|
|
|
|