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

net.dongliu.prettypb.rpc.protocol.RpcRequest 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 = "RpcRequest", protoPackage = "")
public class RpcRequest {
    
    @ProtoField(idx=1, type=ProtoType.Int32, name="correlationId", required=true)
    private int correlationId;
    
    @ProtoField(idx=2, type=ProtoType.String, name="serviceIdentifier", required=true)
    private String serviceIdentifier;
    
    @ProtoField(idx=3, type=ProtoType.String, name="methodIdentifier", required=true)
    private String methodIdentifier;
    
    @ProtoField(idx=4, type=ProtoType.Bytes, name="requestBytes", required=true)
    private byte[] requestBytes;
    
    @ProtoField(idx=5, type=ProtoType.Int32, name="timeoutMs")
    private int timeoutMs;
    
    @ProtoField(idx=101, type=ProtoType.String, name="servicePackage")
    private String servicePackage;
    
    private boolean _correlationId;
    private boolean _serviceIdentifier;
    private boolean _methodIdentifier;
    private boolean _requestBytes;
    private boolean _timeoutMs;
    private boolean _servicePackage;
    
    public int getCorrelationId () {
        return correlationId;
    }
    
    public void setCorrelationId (int correlationId) {
        if (!this._correlationId) this._correlationId = true;
        this.correlationId = correlationId;
    }
    
    public String getServiceIdentifier () {
        return serviceIdentifier;
    }
    
    public void setServiceIdentifier (String serviceIdentifier) {
        if (!this._serviceIdentifier) this._serviceIdentifier = true;
        this.serviceIdentifier = serviceIdentifier;
    }
    
    public String getMethodIdentifier () {
        return methodIdentifier;
    }
    
    public void setMethodIdentifier (String methodIdentifier) {
        if (!this._methodIdentifier) this._methodIdentifier = true;
        this.methodIdentifier = methodIdentifier;
    }
    
    public byte[] getRequestBytes () {
        return requestBytes;
    }
    
    public void setRequestBytes (byte[] requestBytes) {
        if (!this._requestBytes) this._requestBytes = true;
        this.requestBytes = requestBytes;
    }
    
    public int getTimeoutMs () {
        return timeoutMs;
    }
    
    public void setTimeoutMs (int timeoutMs) {
        if (!this._timeoutMs) this._timeoutMs = true;
        this.timeoutMs = timeoutMs;
    }
    
    public String getServicePackage () {
        return servicePackage;
    }
    
    public void setServicePackage (String servicePackage) {
        if (!this._servicePackage) this._servicePackage = true;
        this.servicePackage = servicePackage;
    }
    
    public boolean hasCorrelationId () {
        return _correlationId;
    }
    
    public boolean hasServiceIdentifier () {
        return _serviceIdentifier && serviceIdentifier != null;
    }
    
    public boolean hasMethodIdentifier () {
        return _methodIdentifier && methodIdentifier != null;
    }
    
    public boolean hasRequestBytes () {
        return _requestBytes && requestBytes != null;
    }
    
    public boolean hasTimeoutMs () {
        return _timeoutMs;
    }
    
    public boolean hasServicePackage () {
        return _servicePackage && servicePackage != null;
    }
    
    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder("RpcRequest{\n");
        if (_correlationId)
            sb.append("correlationId: ").append(correlationId).append("\n");
        if (_serviceIdentifier)
            sb.append("serviceIdentifier: ").append(serviceIdentifier).append("\n");
        if (_methodIdentifier)
            sb.append("methodIdentifier: ").append(methodIdentifier).append("\n");
        if (_requestBytes)
            sb.append("requestBytes: ").append(requestBytes).append("\n");
        if (_timeoutMs)
            sb.append("timeoutMs: ").append(timeoutMs).append("\n");
        if (_servicePackage)
            sb.append("servicePackage: ").append(servicePackage).append("\n");
        sb.append("}");
        return sb.toString();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy