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

com.yahoo.config.model.api.PortInfo Maven / Gradle / Ivy

There is a newer version: 8.441.21
Show newest version
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
package com.yahoo.config.model.api;

import java.util.Collection;

/**
 * Contains information about a port (port number and a collection of tags).
 *
 */
public class PortInfo {
    private final int port;
    private final Collection tags;

    public PortInfo(int port, Collection tags) {
        this.port = port;
        this.tags = tags;
    }

    public int getPort() {
        return port;
    }

    public Collection getTags() {
        return tags;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        PortInfo portInfo = (PortInfo) o;

        if (port != portInfo.port) return false;
        if (tags != null ? !tags.equals(portInfo.tags) : portInfo.tags != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = port;
        result = 31 * result + (tags != null ? tags.hashCode() : 0);
        return result;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy