net.dongliu.prettypb.rpc.protocol.ServerInfo Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of prettypb-rpc Show documentation
Show all versions of prettypb-rpc Show documentation
proto rpc libs, compatible with proto-rpc-pro
//Generated by pretty java compiler, DO NOT MODIFY!
package net.dongliu.prettypb.rpc.protocol;
import net.dongliu.prettypb.runtime.include.*;
@ProtoBean(name = "ServerInfo", protoPackage = "")
public class ServerInfo {
@ProtoField(idx=1, type=ProtoType.String, name="host", required=true)
private String host;
@ProtoField(idx=2, type=ProtoType.UInt32, name="port", required=true)
private int port;
@ProtoField(idx=3, type=ProtoType.UInt32, name="weight")
private int weight;
private boolean _host;
private boolean _port;
private boolean _weight;
public String getHost () {
return host;
}
public void setHost (String host) {
if (!this._host) this._host = true;
this.host = host;
}
public int getPort () {
return port;
}
public void setPort (int port) {
if (!this._port) this._port = true;
this.port = port;
}
public int getWeight () {
return weight;
}
public void setWeight (int weight) {
if (!this._weight) this._weight = true;
this.weight = weight;
}
public boolean hasHost () {
return _host && host != null;
}
public boolean hasPort () {
return _port;
}
public boolean hasWeight () {
return _weight;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("ServerInfo{\n");
if (_host)
sb.append("host: ").append(host).append("\n");
if (_port)
sb.append("port: ").append(port).append("\n");
if (_weight)
sb.append("weight: ").append(weight).append("\n");
sb.append("}");
return sb.toString();
}
}