{{#packageName}}
package {{packageName}};
{{/packageName}}

import java.util.concurrent.CompletableFuture;
import java.util.concurrent.atomic.AtomicBoolean;

{{#deprecated}}
    @java.lang.Deprecated
{{/deprecated}}
public interface {{interfaceClassName}} {

    static final String JAVA_SERVICE_NAME = "{{packageName}}.{{serviceName}}";
    static final String SERVICE_NAME = "{{commonPackageName}}.{{serviceName}}";

    // FIXME, initialize Dubbo3 stub when interface loaded, thinking of new ways doing this.
    static final boolean inited = {{className}}.init();

{{#unaryMethods}}
    {{#javaDoc}}
        {{{javaDoc}}}
    {{/javaDoc}}
    {{#deprecated}}
        @java.lang.Deprecated
    {{/deprecated}}
    {{outputType}} {{methodName}}({{inputType}} request);

    default CompletableFuture<{{outputType}}> {{methodName}}Async({{inputType}} request){
        return CompletableFuture.supplyAsync(() -> {{methodName}}(request));
    }

{{/unaryMethods}}

{{#serverStreamingMethods}}
    {{#javaDoc}}
        {{{javaDoc}}}
    {{/javaDoc}}
    {{#deprecated}}
        @java.lang.Deprecated
    {{/deprecated}}
    void {{methodName}}({{inputType}} request, org.apache.dubbo.common.stream.StreamObserver<{{outputType}}> responseObserver);
{{/serverStreamingMethods}}

{{#biStreamingMethods}}
    {{#javaDoc}}
        {{{javaDoc}}}
    {{/javaDoc}}
    {{#deprecated}}
        @java.lang.Deprecated
    {{/deprecated}}
    org.apache.dubbo.common.stream.StreamObserver<{{inputType}}> {{methodName}}(org.apache.dubbo.common.stream.StreamObserver<{{outputType}}> responseObserver);
{{/biStreamingMethods}}

}
