com.eg.agent.android.harvest.TokenData Maven / Gradle / Ivy
The newest version!
package com.eg.agent.android.harvest;
import com.eg.agent.android.harvest.type.ArrayTransformer;
import com.eg.google.gson.JsonArray;
import com.eg.google.gson.JsonPrimitive;
public class TokenData extends ArrayTransformer {
private int accountId = 1;
private int agentId = 1;
public TokenData() {
}
public TokenData(int accountId, int agentId) {
this.accountId = accountId;
this.agentId = agentId;
}
public JsonArray asJsonArray() {
JsonArray array = new JsonArray();
array.add(new JsonPrimitive(Integer.valueOf(this.accountId)));
array.add(new JsonPrimitive(Integer.valueOf(this.agentId)));
return array;
}
public void clear() {
this.accountId = 1;
this.agentId = 1;
}
public int getAccountId() {
return this.accountId;
}
public void setAccountId(int accountId) {
this.accountId = accountId;
}
public int getAgentId() {
return this.agentId;
}
public void setAgentId(int agentId) {
this.agentId = agentId;
}
public boolean isValid() {
return true;
// return this.accountId > 0 && this.agentId > 0;
}
public String toString() {
return "TokenData{accountId=" + this.accountId + ", agentId=" + this.agentId + '}';
}
}