net.dongliu.prettypb.rpc.protocol.ConnectResponse 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 = "ConnectResponse", protoPackage = "")
public class ConnectResponse {
@ProtoField(idx=1, type=ProtoType.Int32, name="correlationId", required=true)
private int correlationId;
@ProtoField(idx=2, type=ProtoType.String, name="serverPID")
private String serverPID;
@ProtoField(idx=3, type=ProtoType.Enum, name="errorCode")
private ConnectErrorCode errorCode;
@ProtoField(idx=4, type=ProtoType.Bool, name="compress")
private boolean compress;
private boolean _correlationId;
private boolean _serverPID;
private boolean _errorCode;
private boolean _compress;
public int getCorrelationId () {
return correlationId;
}
public void setCorrelationId (int correlationId) {
if (!this._correlationId) this._correlationId = true;
this.correlationId = correlationId;
}
public String getServerPID () {
return serverPID;
}
public void setServerPID (String serverPID) {
if (!this._serverPID) this._serverPID = true;
this.serverPID = serverPID;
}
public ConnectErrorCode getErrorCode () {
return errorCode;
}
public void setErrorCode (ConnectErrorCode errorCode) {
if (!this._errorCode) this._errorCode = true;
this.errorCode = errorCode;
}
public boolean isCompress () {
return compress;
}
public void setCompress (boolean compress) {
if (!this._compress) this._compress = true;
this.compress = compress;
}
public boolean hasCorrelationId () {
return _correlationId;
}
public boolean hasServerPID () {
return _serverPID && serverPID != null;
}
public boolean hasErrorCode () {
return _errorCode && errorCode != null;
}
public boolean hasCompress () {
return _compress;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("ConnectResponse{\n");
if (_correlationId)
sb.append("correlationId: ").append(correlationId).append("\n");
if (_serverPID)
sb.append("serverPID: ").append(serverPID).append("\n");
if (_errorCode)
sb.append("errorCode: ").append(errorCode).append("\n");
if (_compress)
sb.append("compress: ").append(compress).append("\n");
sb.append("}");
return sb.toString();
}
}