+ public static class ServerInfo implements Serializable {
+ private static final long serialVersionUID = 1L;
+
+ private final String id;
+ private final boolean isVoting;
+
+ public ServerInfo(@Nonnull String id, boolean isVoting) {
+ this.id = Preconditions.checkNotNull(id);
+ this.isVoting = isVoting;
+ }
+
+ @Nonnull
+ public String getId() {
+ return id;
+ }
+
+ public boolean isVoting() {
+ return isVoting;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (isVoting ? 1231 : 1237);
+ result = prime * result + id.hashCode();
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null || getClass() != obj.getClass()) {
+ return false;
+ }
+
+ ServerInfo other = (ServerInfo) obj;
+ return isVoting == other.isVoting && id.equals(other.id);
+ }
+
+ @Override
+ public String toString() {
+ return "ServerInfo [id=" + id + ", isVoting=" + isVoting + "]";
+ }