All Downloads are FREE. Search and download functionalities are using the official Maven repository.

net.dongliu.prettypb.rpc.protocol.RpcResponse Maven / Gradle / Ivy

There is a newer version: 0.3.5
Show newest version
//Generated by pretty java compiler, DO NOT MODIFY!
package net.dongliu.prettypb.rpc.protocol;
import net.dongliu.prettypb.runtime.include.*;

@ProtoBean(name = "RpcResponse", protoPackage = "")
public class RpcResponse {
    
    @ProtoField(idx=1, type=ProtoType.Int32, name="correlationId", required=true)
    private int correlationId;
    
    @ProtoField(idx=2, type=ProtoType.Bytes, name="responseBytes", required=true)
    private byte[] responseBytes;
    
    private boolean _correlationId;
    private boolean _responseBytes;
    
    public int getCorrelationId () {
        return correlationId;
    }
    
    public void setCorrelationId (int correlationId) {
        if (!this._correlationId) this._correlationId = true;
        this.correlationId = correlationId;
    }
    
    public byte[] getResponseBytes () {
        return responseBytes;
    }
    
    public void setResponseBytes (byte[] responseBytes) {
        if (!this._responseBytes) this._responseBytes = true;
        this.responseBytes = responseBytes;
    }
    
    public boolean hasCorrelationId () {
        return _correlationId;
    }
    
    public boolean hasResponseBytes () {
        return _responseBytes && responseBytes != null;
    }
    
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("RpcResponse{\n");
        if (_correlationId)
            sb.append("correlationId: ").append(correlationId).append("\n");
        if (_responseBytes)
            sb.append("responseBytes: ").append(responseBytes).append("\n");
        sb.append("}");
        return sb.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy