diff options
author | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
---|---|---|
committer | Jon Bratseth <bratseth@yahoo-inc.com> | 2016-06-15 23:09:44 +0200 |
commit | 72231250ed81e10d66bfe70701e64fa5fe50f712 (patch) | |
tree | 2728bba1131a6f6e5bdf95afec7d7ff9358dac50 /config-model-api/src/main/java/com/yahoo/config/model/api/PortInfo.java |
Publish
Diffstat (limited to 'config-model-api/src/main/java/com/yahoo/config/model/api/PortInfo.java')
-rw-r--r-- | config-model-api/src/main/java/com/yahoo/config/model/api/PortInfo.java | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/config-model-api/src/main/java/com/yahoo/config/model/api/PortInfo.java b/config-model-api/src/main/java/com/yahoo/config/model/api/PortInfo.java new file mode 100644 index 00000000000..99f6ae469f3 --- /dev/null +++ b/config-model-api/src/main/java/com/yahoo/config/model/api/PortInfo.java @@ -0,0 +1,46 @@ +// Copyright 2016 Yahoo Inc. 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<String> tags; + + public PortInfo(int port, Collection<String> tags) { + this.port = port; + this.tags = tags; + } + + public int getPort() { + return port; + } + + public Collection<String> 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; + } +} |