Skip to content

Commit

Permalink
Make ServerID immutable
Browse files Browse the repository at this point in the history
  • Loading branch information
vietj committed Sep 24, 2024
1 parent 5d9a28c commit 1b2ed50
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions vertx-core/src/main/java/io/vertx/core/net/impl/ServerID.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,30 +11,29 @@

package io.vertx.core.net.impl;

import java.io.Serializable;
import java.util.Objects;

/**
* @author <a href="http://tfox.org">Tim Fox</a>
*/
public class ServerID implements Serializable {
public class ServerID {

public int port;
public String host;
private final int port;
private final String host;

public ServerID(int port, String host) {
this.port = port;
this.host = host;
}

public ServerID() {
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (!(o instanceof ServerID)) return false;

if (this == o) {
return true;
}
if (!(o instanceof ServerID)) {
return false;
}
ServerID that = (ServerID) o;
return port == that.port && Objects.equals(host, that.host);
}
Expand Down

0 comments on commit 1b2ed50

Please sign in to comment.