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

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

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


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

import java.util.Collection;
import java.util.concurrent.CopyOnWriteArrayList;

public class HttpTransactions extends HarvestableArray {
    private final Collection httpTransactions = new CopyOnWriteArrayList();

    public synchronized void add(HttpTransaction httpTransaction) {
        this.httpTransactions.add(httpTransaction);
    }

    public synchronized void remove(HttpTransaction transaction) {
        this.httpTransactions.remove(transaction);
    }

    public void clear() {
        this.httpTransactions.clear();
    }

    public JsonArray asJsonArray() {
        JsonArray array = new JsonArray();
        for (HttpTransaction transaction : this.httpTransactions) {
            array.add(transaction.asJson());
        }
        return array;
    }

    public Collection getHttpTransactions() {
        return this.httpTransactions;
    }

    public int count() {
        return this.httpTransactions.size();
    }

    public String toString() {
        return "HttpTransactions{httpTransactions=" + this.httpTransactions + '}';
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy