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

io.deepsense.neptune.clientlibrary.models.impl.parameters.ParameterImpl 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.parameters;

import com.google.common.base.Preconditions;
import io.deepsense.neptune.clientlibrary.models.Parameter;
import io.deepsense.neptune.clientlibrary.models.ParameterType;
import io.deepsense.neptune.clientlibrary.models.ParameterValue;

import java.util.Objects;

public class ParameterImpl implements Parameter {

    private final String name;

    private final ParameterType type;

    private final ParameterValue value;

    public ParameterImpl(String name, ParameterType type, ParameterValue value) {
        this.name = Preconditions.checkNotNull(name);
        this.type = Preconditions.checkNotNull(type);
        this.value = Preconditions.checkNotNull(value);
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public ParameterType getType() {
        return type;
    }

    @Override
    public ParameterValue getValue() {
        return value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        ParameterImpl parameter = (ParameterImpl) o;
        return Objects.equals(name, parameter.name)
                && type == parameter.type
                && Objects.equals(value, parameter.value);
    }

    @Override
    public int hashCode() {
        return Objects.hash(name, type, value);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy