All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.eg.agent.android.harvest.DataToken Maven / Gradle / Ivy

There is a newer version: 2.1.3
Show newest version
package com.eg.agent.android.harvest;

/*import com.newrelic.agent.android.harvest.type.HarvestableArray;
import com.newrelic.com.google.gson.JsonArray;
import com.newrelic.com.google.gson.JsonPrimitive;*/

import com.eg.agent.android.harvest.type.HarvestableArray;
import com.eg.google.gson.JsonArray;
import com.eg.google.gson.JsonPrimitive;

public class DataToken extends HarvestableArray {
    private int accountId;
    private int agentId;

    public DataToken() {
    }

    public DataToken(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 = 0;
        this.agentId = 0;
    }

    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 this.accountId > 0 && this.agentId > 0;
    }

    public String toString() {
        return "DataToken{accountId=" + this.accountId + ", agentId=" + this.agentId + '}';
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy