io.deepsense.neptune.clientlibrary.models.impl.charts.ChartImpl Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of neptune-client-library Show documentation
Show all versions of neptune-client-library Show documentation
Enables integration with Neptune in your Java code
/**
* Copyright (c) 2016, CodiLime Inc.
*/
package io.deepsense.neptune.clientlibrary.models.impl.charts;
import com.google.common.base.Preconditions;
import io.deepsense.neptune.clientlibrary.models.Chart;
import io.deepsense.neptune.clientlibrary.models.ChartSeriesCollection;
import java.util.Objects;
import java.util.UUID;
public class ChartImpl implements Chart {
private final UUID id;
private final String name;
private final ChartSeriesCollection series;
public ChartImpl(String name, ChartSeriesCollection series) {
this.id = UUID.randomUUID();
this.name = Preconditions.checkNotNull(name);
this.series = Preconditions.checkNotNull(series);
}
@Override
public UUID getId() {
return id;
}
@Override
public String getName() {
return name;
}
@Override
public ChartSeriesCollection getSeries() {
return series;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ChartImpl chart = (ChartImpl) o;
return Objects.equals(id, chart.id)
&& Objects.equals(name, chart.name)
&& Objects.equals(series, chart.series);
}
@Override
public int hashCode() {
return Objects.hash(id, name, series);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy