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

com.spotinst.sdkjava.model.SpectrumMetricData Maven / Gradle / Ivy

There is a newer version: 1.0.121
Show newest version
package com.spotinst.sdkjava.model;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import java.util.Arrays;
import java.util.LinkedList;
import java.util.List;

@JsonIgnoreProperties(ignoreUnknown = true)
public class SpectrumMetricData {

  private String namespace;
  private List dimensions = new LinkedList<>();
  private List metrics = new LinkedList<>();

  private SpectrumMetricData() {
  }

  public String getNamespace() {
    return this.namespace;
  }

  void setNamespace(String namespace) {
    this.namespace = namespace;
  }

  public List getDimensions() {
    return this.dimensions;
  }

  void setDimensions(List dimensions) {
    this.dimensions = dimensions;
  }

  public List getMetrics() {
    return this.metrics;
  }

  void setMetrics(List metrics) {
    this.metrics = metrics;
  }

  public static class Builder {

    private SpectrumMetricData spectrumMetricData;

    private Builder() {
      this.spectrumMetricData = new SpectrumMetricData();
    }

    public static Builder get() {
        return new Builder();
    }

    public Builder setNamespace(final String namespace) {
      spectrumMetricData.setNamespace(namespace);
      return this;
    }

    public Builder setDimensions(final List dimensions) {
      spectrumMetricData.setDimensions(dimensions);
      return this;
    }

    public Builder setDimensions(SpectrumMetricDimension... dimensions) {
      return setDimensions(Arrays.asList(dimensions));
    }

    public Builder addDimension(SpectrumMetricDimension dimension) {
      spectrumMetricData.dimensions.add(dimension);
      return this;
    }

    public Builder setMetrics(final List metrics) {
      spectrumMetricData.setMetrics(metrics);
      return this;
    }

    public Builder setMetrics(SpectrumMetric... metrics) {
      return setMetrics(Arrays.asList(metrics));
    }

    public Builder addMetric(SpectrumMetric metric) {
      spectrumMetricData.metrics.add(metric);
      return this;
    }

    public SpectrumMetricData build() {
      return spectrumMetricData;
    }
  }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy