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

com.izettle.metrics.influxdb.data.InfluxDbPoint Maven / Gradle / Ivy

There is a newer version: 1.3.4
Show newest version
package com.izettle.metrics.influxdb.data;

import java.util.Collections;
import java.util.Map;

/**
 * This class is a bean that holds time series data of a point. A point co relates to a metric.
 */
public class InfluxDbPoint {
    private String measurement;
    private Map tags = Collections.emptyMap();
    private String timestamp;
    private Map fields = Collections.emptyMap();

    public InfluxDbPoint(final String measurement, final String timestamp, final Map fields) {
        this.measurement = measurement;
        this.timestamp = timestamp;
        if (fields != null) {
            this.fields = Collections.unmodifiableMap(fields);
        }

    }

    public InfluxDbPoint(String measurement, Map tags, String timestamp, Map fields) {
        this.measurement = measurement;
        if (tags != null) {
            this.tags = Collections.unmodifiableMap(tags);
        }
        this.timestamp = timestamp;
        if (fields != null) {
            this.fields = Collections.unmodifiableMap(fields);
        }
    }

    public String getMeasurement() {
        return measurement;
    }

    public void setMeasurement(String measurement) {
        this.measurement = measurement;
    }

    public Map getTags() {
        return tags;
    }

    public void setTags(Map tags) {
        if (tags != null) {
            this.tags = Collections.unmodifiableMap(tags);
        }
    }

    public String getTimestamp() {
        return timestamp;
    }

    public void setTimestamp(String timestamp) {
        this.timestamp = timestamp;
    }

    public Map getFields() {
        return fields;
    }

    public void setFields(Map fields) {
        if (fields != null) {
            this.fields = Collections.unmodifiableMap(fields);
        }
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy