diff --git a/src/main/java/io/scalecube/net/Address.java b/src/main/java/io/scalecube/net/Address.java index 310f899..2555f0b 100644 --- a/src/main/java/io/scalecube/net/Address.java +++ b/src/main/java/io/scalecube/net/Address.java @@ -118,6 +118,26 @@ public int port() { return port; } + /** + * Returns new address instance with the specified port. + * + * @param port port + * @return address instance + */ + public Address port(int port) { + return Address.create(host, port); + } + + /** + * Returns new address instance with applied port offset. + * + * @param portOffset portOffset + * @return address instance + */ + public Address addPortOffset(int portOffset) { + return Address.create(host, port + portOffset); + } + @Override public boolean equals(Object other) { if (this == other) {