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

io.github.azagniotov.metrics.reporter.cloudwatch.DimensionedNameBuilder Maven / Gradle / Ivy

package io.github.azagniotov.metrics.reporter.cloudwatch;

import software.amazon.awssdk.services.cloudwatch.model.Dimension;

import java.util.HashMap;
import java.util.Map;

public class DimensionedNameBuilder {
    private final String name;
    private Map dimensions;

    DimensionedNameBuilder(final String name) {
        this(name, new HashMap<>());
    }

    DimensionedNameBuilder(final String name, final Map dimensions) {
        this.name = name;
        this.dimensions = dimensions;
    }

    public DimensionedName build() {
        return new DimensionedName(this.name, this.dimensions);
    }

    public DimensionedNameBuilder withDimension(final String name, final String value) {
        this.dimensions.put(name, Dimension.builder().name(name).value(value).build());
        return this;
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy