io.deepsense.neptune.clientlibrary.models.impl.channels.OnlineNumericChannel 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.channels;
import io.deepsense.neptune.apiclient.model.InputChannelValues;
import io.deepsense.neptune.clientlibrary.models.ChannelParams;
import io.deepsense.neptune.clientlibrary.models.ChannelType;
import io.deepsense.neptune.clientlibrary.services.apimodelconverter.ApiModelConverter;
import io.deepsense.neptune.clientlibrary.services.channelvaluesender.ChannelValueSendingProxy;
import java.util.UUID;
public class OnlineNumericChannel extends OnlineChannel {
private final boolean isMetric;
public OnlineNumericChannel(
ApiModelConverter apiModelConverter,
ChannelValueSendingProxy channelValueSendingProxy,
long maxChannelValueSize,
UUID id,
ChannelParams channelParams,
boolean isMetric) {
super(apiModelConverter,
channelValueSendingProxy,
maxChannelValueSize,
id,
channelParams.getName(),
channelParams.isHistoryPersisted());
this.isMetric = isMetric;
}
@Override
protected void performRawValueValidations(double x, Double y) {
super.performRawValueValidations(x, y);
ChannelValueValidations.checkIsFinite(y);
}
@Override
public ChannelType getType() {
return ChannelType.NUMERIC;
}
@Override
protected InputChannelValues convertValueToSwaggerModel(double x, Double y) {
return getApiModelConverter().numericChannelValueToApiModel(getId(), x, y, isMetric);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy