io.deepsense.neptune.clientlibrary.models.impl.charts.ChartParamsImpl 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.ChartParams;
import io.deepsense.neptune.clientlibrary.models.ChartSeries;
import java.util.Objects;
import java.util.stream.Collectors;
import java.util.stream.StreamSupport;
public class ChartParamsImpl implements ChartParams {
private final String name;
private final Iterable seriesCollection;
public ChartParamsImpl(String name, Iterable seriesCollection) {
this.name = Preconditions.checkNotNull(name);
this.seriesCollection = StreamSupport
.stream(Preconditions.checkNotNull(seriesCollection).spliterator(), false)
.collect(Collectors.toList());
}
@Override
public String getName() {
return name;
}
@Override
public Iterable getSeries() {
return seriesCollection;
}
@Override
public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
ChartParamsImpl chartParams = (ChartParamsImpl) o;
return Objects.equals(name, chartParams.name)
&& Objects.equals(seriesCollection, chartParams.seriesCollection);
}
@Override
public int hashCode() {
return Objects.hash(name, seriesCollection);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy