net.dongliu.prettypb.rpc.protocol.RpcError 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 = "RpcError", protoPackage = "")
public class RpcError {
@ProtoField(idx=1, type=ProtoType.Int32, name="correlationId", required=true)
private int correlationId;
@ProtoField(idx=2, type=ProtoType.String, name="errorMessage", required=true)
private String errorMessage;
private boolean _correlationId;
private boolean _errorMessage;
public int getCorrelationId () {
return correlationId;
}
public void setCorrelationId (int correlationId) {
if (!this._correlationId) this._correlationId = true;
this.correlationId = correlationId;
}
public String getErrorMessage () {
return errorMessage;
}
public void setErrorMessage (String errorMessage) {
if (!this._errorMessage) this._errorMessage = true;
this.errorMessage = errorMessage;
}
public boolean hasCorrelationId () {
return _correlationId;
}
public boolean hasErrorMessage () {
return _errorMessage && errorMessage != null;
}
@Override
public String toString() {
StringBuilder sb = new StringBuilder("RpcError{\n");
if (_correlationId)
sb.append("correlationId: ").append(correlationId).append("\n");
if (_errorMessage)
sb.append("errorMessage: ").append(errorMessage).append("\n");
sb.append("}");
return sb.toString();
}
}