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

io.deepsense.neptune.clientlibrary.models.impl.MetricImpl Maven / Gradle / Ivy

There is a newer version: 1.6.1
Show newest version
/**
 * Copyright (c) 2016, CodiLime Inc.
 */

package io.deepsense.neptune.clientlibrary.models.impl;

import io.deepsense.neptune.apiclient.model.MetricDirection;
import io.deepsense.neptune.clientlibrary.models.Metric;

import java.util.Objects;

public class MetricImpl implements Metric {

    private final String channelName;

    private final MetricDirection metricDirection;

    public MetricImpl(String channelName, MetricDirection metricDirection) {
        this.channelName = channelName;
        this.metricDirection = metricDirection;
    }

    @Override
    public String getChannelName() {
        return channelName;
    }

    @Override
    public MetricDirection getMetricDirection() {
        return metricDirection;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        MetricImpl metric = (MetricImpl) o;
        return Objects.equals(channelName, metric.channelName)
                && metricDirection == metric.metricDirection;
    }

    @Override
    public int hashCode() {
        return Objects.hash(channelName, metricDirection);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy