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

io.deepsense.neptune.clientlibrary.config.internal.ChannelValueBufferConfiguration Maven / Gradle / Ivy

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

package io.deepsense.neptune.clientlibrary.config.internal;

import java.util.Objects;

public class ChannelValueBufferConfiguration {

    private final int maxPackageCount;

    private final double maxBatchSizeAsFractionOfRequestSize;

    private final long minIntervalBetweenSendsMillis;

    public ChannelValueBufferConfiguration(
            int maxPackageCount,
            double maxBatchSizeAsFractionOfRequestSize,
            long minIntervalBetweenSendsMillis) {
        this.maxPackageCount = maxPackageCount;
        this.maxBatchSizeAsFractionOfRequestSize = maxBatchSizeAsFractionOfRequestSize;
        this.minIntervalBetweenSendsMillis = minIntervalBetweenSendsMillis;
    }

    public int getMaxPackageCount() {
        return maxPackageCount;
    }

    public double getMaxBatchSizeAsFractionOfRequestSize() {
        return maxBatchSizeAsFractionOfRequestSize;
    }

    public long getMinIntervalBetweenSendsMillis() {
        return minIntervalBetweenSendsMillis;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ChannelValueBufferConfiguration that = (ChannelValueBufferConfiguration) o;
        return maxPackageCount == that.maxPackageCount
               && maxBatchSizeAsFractionOfRequestSize == that.maxBatchSizeAsFractionOfRequestSize
               && minIntervalBetweenSendsMillis == that.minIntervalBetweenSendsMillis;
    }

    @Override
    public int hashCode() {
        return Objects.hash(maxPackageCount, maxBatchSizeAsFractionOfRequestSize, minIntervalBetweenSendsMillis);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy