├── grpc-eureka-server ├── src │ ├── main │ │ ├── resources │ │ │ ├── application-slave1.yml │ │ │ ├── application-slave2.yml │ │ │ └── application.yml │ │ └── java │ │ │ └── com │ │ │ └── linshen │ │ │ └── grpceurekaserver │ │ │ └── GrpcEurekaServerApplication.java │ └── test │ │ └── java │ │ └── com │ │ └── linshen │ │ └── grpceurekaserver │ │ └── GrpcEurekaServerApplicationTests.java ├── .gitignore └── pom.xml ├── grpc-springboot-cloud-lib ├── src │ └── main │ │ ├── proto │ │ └── greeter.proto │ │ └── java │ │ └── com │ │ └── linshen │ │ └── grpc │ │ └── cloud │ │ └── lib │ │ ├── GreeterGrpc.java │ │ └── GreeterOuterClass.java └── pom.xml ├── grpc-spring-cloud-consumer ├── .gitignore ├── src │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── linshen │ │ │ └── grpcspringcloudconsumer │ │ │ └── GrpcSpringCloudConsumerApplicationTests.java │ └── main │ │ ├── java │ │ └── com │ │ │ └── linshen │ │ │ └── grpcspringcloudconsumer │ │ │ ├── GrpcSpringCloudConsumerApplication.java │ │ │ ├── GrpcClientController.java │ │ │ └── GrpcClientService.java │ │ └── resources │ │ └── application.yml └── pom.xml ├── grpc-spring-cloud-provider ├── .gitignore ├── src │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── linshen │ │ │ └── grpcspringcloudprovider │ │ │ └── GrpcSpringCloudProviderApplicationTests.java │ └── main │ │ ├── java │ │ └── com │ │ │ └── linshen │ │ │ └── grpcspringcloudprovider │ │ │ ├── GrpcSpringCloudProviderApplication.java │ │ │ └── GreeterService.java │ │ └── resources │ │ └── application.yml └── pom.xml ├── .gitignore └── pom.xml /grpc-eureka-server/src/main/resources/application-slave1.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8781 3 | eureka: 4 | client: 5 | service-url: 6 | defaultZone: http://${cloudServerSlave2:localhost}:8782/eureka/ 7 | instance: 8 | hostname: ${cloudServerSlave1:localhost} 9 | server: 10 | enable-self-preservation: false 11 | -------------------------------------------------------------------------------- /grpc-eureka-server/src/main/resources/application-slave2.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 8782 3 | eureka: 4 | client: 5 | service-url: 6 | defaultZone: http://${cloudServerSlave1:localhost}:8781/eureka/ 7 | instance: 8 | hostname: ${cloudServerSlave2:localhost} 9 | server: 10 | enable-self-preservation: false 11 | -------------------------------------------------------------------------------- /grpc-springboot-cloud-lib/src/main/proto/greeter.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | option java_package = "com.linshen.grpc.cloud.lib"; 4 | 5 | service Greeter { 6 | rpc SayHello ( HelloRequest) returns ( HelloReply) {} 7 | 8 | } 9 | message HelloRequest { 10 | string name = 1; 11 | } 12 | message HelloReply { 13 | string message = 1; 14 | } 15 | 16 | 17 | -------------------------------------------------------------------------------- /grpc-eureka-server/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | .mvn 4 | mvnw 5 | mvnw.cmd 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | 21 | ### NetBeans ### 22 | /nbproject/private/ 23 | /build/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ -------------------------------------------------------------------------------- /grpc-spring-cloud-consumer/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | .mvn 4 | mvnw 5 | mvnw.cmd 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | 21 | ### NetBeans ### 22 | /nbproject/private/ 23 | /build/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ -------------------------------------------------------------------------------- /grpc-spring-cloud-provider/.gitignore: -------------------------------------------------------------------------------- 1 | /target/ 2 | !.mvn/wrapper/maven-wrapper.jar 3 | .mvn 4 | mvnw 5 | mvnw.cmd 6 | ### STS ### 7 | .apt_generated 8 | .classpath 9 | .factorypath 10 | .project 11 | .settings 12 | .springBeans 13 | .sts4-cache 14 | 15 | ### IntelliJ IDEA ### 16 | .idea 17 | *.iws 18 | *.iml 19 | *.ipr 20 | 21 | ### NetBeans ### 22 | /nbproject/private/ 23 | /build/ 24 | /nbbuild/ 25 | /dist/ 26 | /nbdist/ 27 | /.nb-gradle/ -------------------------------------------------------------------------------- /grpc-eureka-server/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | spring: 2 | application: 3 | name: grpc-eureka-server 4 | profiles: 5 | active: ${grpc-eureka-profile:slave1} 6 | # actuator management 7 | management: 8 | endpoint: 9 | health: 10 | show-details: always 11 | endpoints: 12 | web: 13 | exposure: 14 | include: '*' 15 | 16 | # actuator info 17 | info: 18 | app: 19 | encoding:UTF-8 20 | java.source:1.8 21 | java.traget:1.8 -------------------------------------------------------------------------------- /grpc-eureka-server/src/test/java/com/linshen/grpceurekaserver/GrpcEurekaServerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.linshen.grpceurekaserver; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GrpcEurekaServerApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /grpc-spring-cloud-consumer/src/test/java/com/linshen/grpcspringcloudconsumer/GrpcSpringCloudConsumerApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.linshen.grpcspringcloudconsumer; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GrpcSpringCloudConsumerApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /grpc-spring-cloud-provider/src/test/java/com/linshen/grpcspringcloudprovider/GrpcSpringCloudProviderApplicationTests.java: -------------------------------------------------------------------------------- 1 | package com.linshen.grpcspringcloudprovider; 2 | 3 | import org.junit.Test; 4 | import org.junit.runner.RunWith; 5 | import org.springframework.boot.test.context.SpringBootTest; 6 | import org.springframework.test.context.junit4.SpringRunner; 7 | 8 | @RunWith(SpringRunner.class) 9 | @SpringBootTest 10 | public class GrpcSpringCloudProviderApplicationTests { 11 | 12 | @Test 13 | public void contextLoads() { 14 | } 15 | 16 | } 17 | -------------------------------------------------------------------------------- /grpc-eureka-server/src/main/java/com/linshen/grpceurekaserver/GrpcEurekaServerApplication.java: -------------------------------------------------------------------------------- 1 | package com.linshen.grpceurekaserver; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer; 6 | 7 | @SpringBootApplication 8 | @EnableEurekaServer 9 | public class GrpcEurekaServerApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(GrpcEurekaServerApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /grpc-spring-cloud-consumer/src/main/java/com/linshen/grpcspringcloudconsumer/GrpcSpringCloudConsumerApplication.java: -------------------------------------------------------------------------------- 1 | package com.linshen.grpcspringcloudconsumer; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @SpringBootApplication 8 | @EnableDiscoveryClient 9 | public class GrpcSpringCloudConsumerApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(GrpcSpringCloudConsumerApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /grpc-spring-cloud-provider/src/main/java/com/linshen/grpcspringcloudprovider/GrpcSpringCloudProviderApplication.java: -------------------------------------------------------------------------------- 1 | package com.linshen.grpcspringcloudprovider; 2 | 3 | import org.springframework.boot.SpringApplication; 4 | import org.springframework.boot.autoconfigure.SpringBootApplication; 5 | import org.springframework.cloud.client.discovery.EnableDiscoveryClient; 6 | 7 | @SpringBootApplication 8 | @EnableDiscoveryClient 9 | public class GrpcSpringCloudProviderApplication { 10 | 11 | public static void main(String[] args) { 12 | SpringApplication.run(GrpcSpringCloudProviderApplication.class, args); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /grpc-spring-cloud-consumer/src/main/java/com/linshen/grpcspringcloudconsumer/GrpcClientController.java: -------------------------------------------------------------------------------- 1 | package com.linshen.grpcspringcloudconsumer; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.web.bind.annotation.RequestMapping; 5 | import org.springframework.web.bind.annotation.RequestParam; 6 | import org.springframework.web.bind.annotation.RestController; 7 | 8 | @RestController 9 | public class GrpcClientController { 10 | 11 | @Autowired 12 | private GrpcClientService grpcClientService; 13 | 14 | @RequestMapping("/") 15 | public String printMessage(@RequestParam(defaultValue = "LinShen") String name) { 16 | return grpcClientService.sendMessage(name); 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /grpc-spring-cloud-consumer/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 0 3 | spring: 4 | application: 5 | name: grpc-spring-cloud-consumer 6 | eureka: 7 | client: 8 | service-url: 9 | defaultZone: http://${cloudServerSlave1:localhost}:8781/eureka/,http://${cloudServerSlave2:localhost}:8782/eureka/ 10 | instance: 11 | instance-id: ${spring.application.name}:${random.uuid} 12 | logging: 13 | level: 14 | org.springframework.web.servlet.DispatcherServlet: DEBUG 15 | # actuator management 16 | management: 17 | endpoint: 18 | health: 19 | show-details: always 20 | endpoints: 21 | web: 22 | exposure: 23 | include: '*' 24 | # actuator info 25 | info: 26 | app: 27 | encoding:UTF-8 28 | java.source:1.8 29 | java.traget:1.8 30 | name:grpc-spring-cloud-consumer -------------------------------------------------------------------------------- /grpc-spring-cloud-provider/src/main/resources/application.yml: -------------------------------------------------------------------------------- 1 | server: 2 | port: 0 3 | grpc: 4 | server: 5 | port: 0 6 | spring: 7 | application: 8 | name: grpc-spring-cloud-provider 9 | eureka: 10 | client: 11 | service-url: 12 | defaultZone: http://${cloudServerSlave1:localhost}:8781/eureka/,http://${cloudServerSlave2:localhost}:8782/eureka/ 13 | instance: 14 | instance-id: ${spring.application.name}:${random.uuid} 15 | logging: 16 | level: 17 | org.springframework.web.servlet.DispatcherServlet: DEBUG 18 | # actuator management 19 | management: 20 | endpoint: 21 | health: 22 | show-details: always 23 | endpoints: 24 | web: 25 | exposure: 26 | include: '*' 27 | # actuator info 28 | info: 29 | app: 30 | encoding:UTF-8 31 | java.source:1.8 32 | java.traget:1.8 33 | name:grpc-spring-cloud-provider 34 | -------------------------------------------------------------------------------- /grpc-spring-cloud-consumer/src/main/java/com/linshen/grpcspringcloudconsumer/GrpcClientService.java: -------------------------------------------------------------------------------- 1 | package com.linshen.grpcspringcloudconsumer; 2 | 3 | import com.linshen.grpc.cloud.lib.GreeterGrpc; 4 | import com.linshen.grpc.cloud.lib.GreeterOuterClass; 5 | import io.grpc.Channel; 6 | import net.devh.springboot.autoconfigure.grpc.client.GrpcClient; 7 | import org.springframework.stereotype.Service; 8 | 9 | @Service 10 | public class GrpcClientService { 11 | 12 | @GrpcClient("grpc-spring-cloud-provider") 13 | private Channel serverChannel; 14 | 15 | public String sendMessage(String name) { 16 | GreeterGrpc.GreeterBlockingStub stub= GreeterGrpc.newBlockingStub(serverChannel); 17 | GreeterOuterClass.HelloReply response = stub.sayHello(GreeterOuterClass.HelloRequest.newBuilder().setName(name).build()); 18 | return response.getMessage(); 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /grpc-spring-cloud-provider/src/main/java/com/linshen/grpcspringcloudprovider/GreeterService.java: -------------------------------------------------------------------------------- 1 | package com.linshen.grpcspringcloudprovider; 2 | 3 | import com.linshen.grpc.cloud.lib.GreeterGrpc; 4 | import com.linshen.grpc.cloud.lib.GreeterOuterClass; 5 | import io.grpc.stub.StreamObserver; 6 | import lombok.extern.slf4j.Slf4j; 7 | import net.devh.springboot.autoconfigure.grpc.server.GrpcService; 8 | 9 | @Slf4j 10 | @GrpcService(GreeterOuterClass.class) 11 | public class GreeterService extends GreeterGrpc.GreeterImplBase { 12 | @Override 13 | public void sayHello(GreeterOuterClass.HelloRequest request, StreamObserver responseObserver) { 14 | String message = "Hello " + request.getName(); 15 | final GreeterOuterClass.HelloReply.Builder replyBuilder = GreeterOuterClass.HelloReply.newBuilder().setMessage(message); 16 | responseObserver.onNext(replyBuilder.build()); 17 | responseObserver.onCompleted(); 18 | log.info("Returning " +message); 19 | } 20 | } -------------------------------------------------------------------------------- /grpc-eureka-server/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | grpc-eureka-server 7 | jar 8 | 9 | grpc-eureka-server 10 | 11 | 12 | grpc-springboot-cloud 13 | com.linshen 14 | 1.0-SNAPSHOT 15 | 16 | 17 | 18 | 19 | org.springframework.cloud 20 | spring-cloud-starter-netflix-eureka-server 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-actuator 25 | 26 | 27 | org.springframework.boot 28 | spring-boot-starter-test 29 | test 30 | 31 | 32 | 33 | 34 | 35 | 36 | org.springframework.boot 37 | spring-boot-maven-plugin 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Created by .ignore support plugin (hsz.mobi) 2 | ### JetBrains template 3 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and WebStorm 4 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 5 | .idea 6 | grpc-springboot-cloud.iml 7 | # User-specific stuff 8 | .idea/**/workspace.xml 9 | .idea/**/tasks.xml 10 | .idea/**/usage.statistics.xml 11 | .idea/**/dictionaries 12 | .idea/**/shelf 13 | 14 | # Sensitive or high-churn files 15 | .idea/**/dataSources/ 16 | .idea/**/dataSources.ids 17 | .idea/**/dataSources.local.xml 18 | .idea/**/sqlDataSources.xml 19 | .idea/**/dynamic.xml 20 | .idea/**/uiDesigner.xml 21 | .idea/**/dbnavigator.xml 22 | 23 | # Gradle 24 | .idea/**/gradle.xml 25 | .idea/**/libraries 26 | 27 | # Gradle and Maven with auto-import 28 | # When using Gradle or Maven with auto-import, you should exclude module files, 29 | # since they will be recreated, and may cause churn. Uncomment if using 30 | # auto-import. 31 | # .idea/modules.xml 32 | # .idea/*.iml 33 | # .idea/modules 34 | 35 | # CMake 36 | cmake-build-*/ 37 | 38 | # Mongo Explorer plugin 39 | .idea/**/mongoSettings.xml 40 | 41 | # File-based project format 42 | *.iws 43 | 44 | # IntelliJ 45 | out/ 46 | 47 | # mpeltonen/sbt-idea plugin 48 | .idea_modules/ 49 | 50 | # JIRA plugin 51 | atlassian-ide-plugin.xml 52 | 53 | # Cursive Clojure plugin 54 | .idea/replstate.xml 55 | 56 | # Crashlytics plugin (for Android Studio and IntelliJ) 57 | com_crashlytics_export_strings.xml 58 | crashlytics.properties 59 | crashlytics-build.properties 60 | fabric.properties 61 | 62 | # Editor-based Rest Client 63 | .idea/httpRequests 64 | 65 | -------------------------------------------------------------------------------- /grpc-spring-cloud-consumer/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | grpc-spring-cloud-consumer 7 | jar 8 | 9 | grpc-spring-cloud-consumer 10 | 11 | 12 | grpc-springboot-cloud 13 | com.linshen 14 | 1.0-SNAPSHOT 15 | 16 | 17 | 18 | 19 | com.linshen 20 | grpc-springboot-cloud-lib 21 | 22 | 23 | org.springframework.boot 24 | spring-boot-starter-web 25 | 26 | 27 | org.springframework.cloud 28 | spring-cloud-starter-netflix-eureka-client 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-starter-actuator 33 | 34 | 35 | org.projectlombok 36 | lombok 37 | true 38 | 39 | 40 | org.springframework.boot 41 | spring-boot-starter-test 42 | test 43 | 44 | 45 | net.devh 46 | grpc-client-spring-boot-starter 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.springframework.boot 54 | spring-boot-maven-plugin 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /grpc-spring-cloud-provider/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | grpc-spring-cloud-provider 7 | jar 8 | 9 | grpc-spring-cloud-provider 10 | 11 | 12 | grpc-springboot-cloud 13 | com.linshen 14 | 1.0-SNAPSHOT 15 | 16 | 17 | 18 | 19 | com.linshen 20 | grpc-springboot-cloud-lib 21 | 22 | 23 | org.springframework.cloud 24 | spring-cloud-starter-netflix-eureka-client 25 | 26 | 27 | org.springframework.boot 28 | spring-boot-starter-web 29 | 30 | 31 | org.springframework.boot 32 | spring-boot-starter-actuator 33 | 34 | 35 | org.projectlombok 36 | lombok 37 | true 38 | 39 | 40 | org.springframework.boot 41 | spring-boot-starter-test 42 | test 43 | 44 | 45 | net.devh 46 | grpc-server-spring-boot-starter 47 | 48 | 49 | 50 | 51 | 52 | 53 | org.springframework.boot 54 | spring-boot-maven-plugin 55 | 56 | 57 | 58 | 59 | 60 | -------------------------------------------------------------------------------- /grpc-springboot-cloud-lib/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | grpc-springboot-cloud 7 | com.linshen 8 | 1.0-SNAPSHOT 9 | 10 | 4.0.0 11 | 12 | grpc-springboot-cloud-lib 13 | jar 14 | 15 | 16 | 1.6.0 17 | 1.15.1 18 | 3.6.1 19 | 0.6.1 20 | 21 | **/com/linshen/grpc/cloud/lib/* 22 | 23 | 24 | 25 | 26 | 27 | io.grpc 28 | grpc-all 29 | ${grpc.version} 30 | 31 | 32 | 33 | 34 | 35 | 36 | kr.motd.maven 37 | os-maven-plugin 38 | ${os.plugin.version} 39 | 40 | 41 | 42 | 43 | org.xolstice.maven.plugins 44 | protobuf-maven-plugin 45 | ${protobuf.plugin.version} 46 | true 47 | 48 | com.google.protobuf:protoc:${protoc.version}:exe:${os.detected.classifier} 49 | grpc-java 50 | io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier} 51 | 52 | ${project.basedir}/src/main/proto 53 | 54 | 55 | ${project.basedir}/src/main/java 56 | 57 | false 58 | 59 | 60 | 61 | 62 | 63 | compile 64 | 65 | 66 | compile 67 | 68 | compile-custom 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.linshen 8 | grpc-springboot-cloud 9 | pom 10 | 1.0-SNAPSHOT 11 | 12 | 13 | org.springframework.boot 14 | spring-boot-starter-parent 15 | 2.0.5.RELEASE 16 | 17 | 18 | 19 | grpc-springboot-cloud-lib 20 | grpc-eureka-server 21 | grpc-spring-cloud-provider 22 | grpc-spring-cloud-consumer 23 | 24 | 25 | 26 | UTF-8 27 | UTF-8 28 | 1.8 29 | ${project.parent.version} 30 | 2.0.1.RELEASE 31 | Finchley.SR1 32 | 33 | 9129bbeb9b95ea497d14761ffaf55d19a2d63ce3 34 | 35 | 36 | http://120.79.168.114:9000 37 | 38 | 39 | 40 | 41 | 42 | 43 | org.springframework.cloud 44 | spring-cloud-dependencies 45 | ${spring-cloud.version} 46 | pom 47 | import 48 | 49 | 50 | 51 | com.linshen 52 | grpc-springboot-cloud-lib 53 | ${project.version} 54 | 55 | 56 | 57 | net.devh 58 | grpc-client-spring-boot-starter 59 | ${net-devh-grpc.version} 60 | 61 | 62 | net.devh 63 | grpc-server-spring-boot-starter 64 | ${net-devh-grpc.version} 65 | 66 | 67 | 68 | 69 | 70 | 71 | rdc-releases 72 | https://repo.rdc.aliyun.com/repository/33942-release-ynuR2y/ 73 | 74 | 75 | rdc-snapshots 76 | https://repo.rdc.aliyun.com/repository/33942-snapshot-LEgirb/ 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | org.sonarsource.scanner.maven 85 | sonar-maven-plugin 86 | 3.5.0.1254 87 | 88 | 89 | 90 | 91 | -------------------------------------------------------------------------------- /grpc-springboot-cloud-lib/src/main/java/com/linshen/grpc/cloud/lib/GreeterGrpc.java: -------------------------------------------------------------------------------- 1 | package com.linshen.grpc.cloud.lib; 2 | 3 | import static io.grpc.MethodDescriptor.generateFullMethodName; 4 | import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall; 5 | import static io.grpc.stub.ClientCalls.asyncClientStreamingCall; 6 | import static io.grpc.stub.ClientCalls.asyncServerStreamingCall; 7 | import static io.grpc.stub.ClientCalls.asyncUnaryCall; 8 | import static io.grpc.stub.ClientCalls.blockingServerStreamingCall; 9 | import static io.grpc.stub.ClientCalls.blockingUnaryCall; 10 | import static io.grpc.stub.ClientCalls.futureUnaryCall; 11 | import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall; 12 | import static io.grpc.stub.ServerCalls.asyncClientStreamingCall; 13 | import static io.grpc.stub.ServerCalls.asyncServerStreamingCall; 14 | import static io.grpc.stub.ServerCalls.asyncUnaryCall; 15 | import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall; 16 | import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall; 17 | 18 | /** 19 | */ 20 | @javax.annotation.Generated( 21 | value = "by gRPC proto compiler (version 1.15.1)", 22 | comments = "Source: greeter.proto") 23 | public final class GreeterGrpc { 24 | 25 | private GreeterGrpc() {} 26 | 27 | public static final String SERVICE_NAME = "Greeter"; 28 | 29 | // Static method descriptors that strictly reflect the proto. 30 | private static volatile io.grpc.MethodDescriptor getSayHelloMethod; 32 | 33 | @io.grpc.stub.annotations.RpcMethod( 34 | fullMethodName = SERVICE_NAME + '/' + "SayHello", 35 | requestType = com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest.class, 36 | responseType = com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply.class, 37 | methodType = io.grpc.MethodDescriptor.MethodType.UNARY) 38 | public static io.grpc.MethodDescriptor getSayHelloMethod() { 40 | io.grpc.MethodDescriptor getSayHelloMethod; 41 | if ((getSayHelloMethod = GreeterGrpc.getSayHelloMethod) == null) { 42 | synchronized (GreeterGrpc.class) { 43 | if ((getSayHelloMethod = GreeterGrpc.getSayHelloMethod) == null) { 44 | GreeterGrpc.getSayHelloMethod = getSayHelloMethod = 45 | io.grpc.MethodDescriptor.newBuilder() 46 | .setType(io.grpc.MethodDescriptor.MethodType.UNARY) 47 | .setFullMethodName(generateFullMethodName( 48 | "Greeter", "SayHello")) 49 | .setSampledToLocalTracing(true) 50 | .setRequestMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( 51 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest.getDefaultInstance())) 52 | .setResponseMarshaller(io.grpc.protobuf.ProtoUtils.marshaller( 53 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply.getDefaultInstance())) 54 | .setSchemaDescriptor(new GreeterMethodDescriptorSupplier("SayHello")) 55 | .build(); 56 | } 57 | } 58 | } 59 | return getSayHelloMethod; 60 | } 61 | 62 | /** 63 | * Creates a new async stub that supports all call types for the service 64 | */ 65 | public static GreeterStub newStub(io.grpc.Channel channel) { 66 | return new GreeterStub(channel); 67 | } 68 | 69 | /** 70 | * Creates a new blocking-style stub that supports unary and streaming output calls on the service 71 | */ 72 | public static GreeterBlockingStub newBlockingStub( 73 | io.grpc.Channel channel) { 74 | return new GreeterBlockingStub(channel); 75 | } 76 | 77 | /** 78 | * Creates a new ListenableFuture-style stub that supports unary calls on the service 79 | */ 80 | public static GreeterFutureStub newFutureStub( 81 | io.grpc.Channel channel) { 82 | return new GreeterFutureStub(channel); 83 | } 84 | 85 | /** 86 | */ 87 | public static abstract class GreeterImplBase implements io.grpc.BindableService { 88 | 89 | /** 90 | */ 91 | public void sayHello(com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest request, 92 | io.grpc.stub.StreamObserver responseObserver) { 93 | asyncUnimplementedUnaryCall(getSayHelloMethod(), responseObserver); 94 | } 95 | 96 | @java.lang.Override public final io.grpc.ServerServiceDefinition bindService() { 97 | return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor()) 98 | .addMethod( 99 | getSayHelloMethod(), 100 | asyncUnaryCall( 101 | new MethodHandlers< 102 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest, 103 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply>( 104 | this, METHODID_SAY_HELLO))) 105 | .build(); 106 | } 107 | } 108 | 109 | /** 110 | */ 111 | public static final class GreeterStub extends io.grpc.stub.AbstractStub { 112 | private GreeterStub(io.grpc.Channel channel) { 113 | super(channel); 114 | } 115 | 116 | private GreeterStub(io.grpc.Channel channel, 117 | io.grpc.CallOptions callOptions) { 118 | super(channel, callOptions); 119 | } 120 | 121 | @java.lang.Override 122 | protected GreeterStub build(io.grpc.Channel channel, 123 | io.grpc.CallOptions callOptions) { 124 | return new GreeterStub(channel, callOptions); 125 | } 126 | 127 | /** 128 | */ 129 | public void sayHello(com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest request, 130 | io.grpc.stub.StreamObserver responseObserver) { 131 | asyncUnaryCall( 132 | getChannel().newCall(getSayHelloMethod(), getCallOptions()), request, responseObserver); 133 | } 134 | } 135 | 136 | /** 137 | */ 138 | public static final class GreeterBlockingStub extends io.grpc.stub.AbstractStub { 139 | private GreeterBlockingStub(io.grpc.Channel channel) { 140 | super(channel); 141 | } 142 | 143 | private GreeterBlockingStub(io.grpc.Channel channel, 144 | io.grpc.CallOptions callOptions) { 145 | super(channel, callOptions); 146 | } 147 | 148 | @java.lang.Override 149 | protected GreeterBlockingStub build(io.grpc.Channel channel, 150 | io.grpc.CallOptions callOptions) { 151 | return new GreeterBlockingStub(channel, callOptions); 152 | } 153 | 154 | /** 155 | */ 156 | public com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply sayHello(com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest request) { 157 | return blockingUnaryCall( 158 | getChannel(), getSayHelloMethod(), getCallOptions(), request); 159 | } 160 | } 161 | 162 | /** 163 | */ 164 | public static final class GreeterFutureStub extends io.grpc.stub.AbstractStub { 165 | private GreeterFutureStub(io.grpc.Channel channel) { 166 | super(channel); 167 | } 168 | 169 | private GreeterFutureStub(io.grpc.Channel channel, 170 | io.grpc.CallOptions callOptions) { 171 | super(channel, callOptions); 172 | } 173 | 174 | @java.lang.Override 175 | protected GreeterFutureStub build(io.grpc.Channel channel, 176 | io.grpc.CallOptions callOptions) { 177 | return new GreeterFutureStub(channel, callOptions); 178 | } 179 | 180 | /** 181 | */ 182 | public com.google.common.util.concurrent.ListenableFuture sayHello( 183 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest request) { 184 | return futureUnaryCall( 185 | getChannel().newCall(getSayHelloMethod(), getCallOptions()), request); 186 | } 187 | } 188 | 189 | private static final int METHODID_SAY_HELLO = 0; 190 | 191 | private static final class MethodHandlers implements 192 | io.grpc.stub.ServerCalls.UnaryMethod, 193 | io.grpc.stub.ServerCalls.ServerStreamingMethod, 194 | io.grpc.stub.ServerCalls.ClientStreamingMethod, 195 | io.grpc.stub.ServerCalls.BidiStreamingMethod { 196 | private final GreeterImplBase serviceImpl; 197 | private final int methodId; 198 | 199 | MethodHandlers(GreeterImplBase serviceImpl, int methodId) { 200 | this.serviceImpl = serviceImpl; 201 | this.methodId = methodId; 202 | } 203 | 204 | @java.lang.Override 205 | @java.lang.SuppressWarnings("unchecked") 206 | public void invoke(Req request, io.grpc.stub.StreamObserver responseObserver) { 207 | switch (methodId) { 208 | case METHODID_SAY_HELLO: 209 | serviceImpl.sayHello((com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest) request, 210 | (io.grpc.stub.StreamObserver) responseObserver); 211 | break; 212 | default: 213 | throw new AssertionError(); 214 | } 215 | } 216 | 217 | @java.lang.Override 218 | @java.lang.SuppressWarnings("unchecked") 219 | public io.grpc.stub.StreamObserver invoke( 220 | io.grpc.stub.StreamObserver responseObserver) { 221 | switch (methodId) { 222 | default: 223 | throw new AssertionError(); 224 | } 225 | } 226 | } 227 | 228 | private static abstract class GreeterBaseDescriptorSupplier 229 | implements io.grpc.protobuf.ProtoFileDescriptorSupplier, io.grpc.protobuf.ProtoServiceDescriptorSupplier { 230 | GreeterBaseDescriptorSupplier() {} 231 | 232 | @java.lang.Override 233 | public com.google.protobuf.Descriptors.FileDescriptor getFileDescriptor() { 234 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.getDescriptor(); 235 | } 236 | 237 | @java.lang.Override 238 | public com.google.protobuf.Descriptors.ServiceDescriptor getServiceDescriptor() { 239 | return getFileDescriptor().findServiceByName("Greeter"); 240 | } 241 | } 242 | 243 | private static final class GreeterFileDescriptorSupplier 244 | extends GreeterBaseDescriptorSupplier { 245 | GreeterFileDescriptorSupplier() {} 246 | } 247 | 248 | private static final class GreeterMethodDescriptorSupplier 249 | extends GreeterBaseDescriptorSupplier 250 | implements io.grpc.protobuf.ProtoMethodDescriptorSupplier { 251 | private final String methodName; 252 | 253 | GreeterMethodDescriptorSupplier(String methodName) { 254 | this.methodName = methodName; 255 | } 256 | 257 | @java.lang.Override 258 | public com.google.protobuf.Descriptors.MethodDescriptor getMethodDescriptor() { 259 | return getServiceDescriptor().findMethodByName(methodName); 260 | } 261 | } 262 | 263 | private static volatile io.grpc.ServiceDescriptor serviceDescriptor; 264 | 265 | public static io.grpc.ServiceDescriptor getServiceDescriptor() { 266 | io.grpc.ServiceDescriptor result = serviceDescriptor; 267 | if (result == null) { 268 | synchronized (GreeterGrpc.class) { 269 | result = serviceDescriptor; 270 | if (result == null) { 271 | serviceDescriptor = result = io.grpc.ServiceDescriptor.newBuilder(SERVICE_NAME) 272 | .setSchemaDescriptor(new GreeterFileDescriptorSupplier()) 273 | .addMethod(getSayHelloMethod()) 274 | .build(); 275 | } 276 | } 277 | } 278 | return result; 279 | } 280 | } 281 | -------------------------------------------------------------------------------- /grpc-springboot-cloud-lib/src/main/java/com/linshen/grpc/cloud/lib/GreeterOuterClass.java: -------------------------------------------------------------------------------- 1 | // Generated by the protocol buffer compiler. DO NOT EDIT! 2 | // source: greeter.proto 3 | 4 | package com.linshen.grpc.cloud.lib; 5 | 6 | public final class GreeterOuterClass { 7 | private GreeterOuterClass() {} 8 | public static void registerAllExtensions( 9 | com.google.protobuf.ExtensionRegistryLite registry) { 10 | } 11 | 12 | public static void registerAllExtensions( 13 | com.google.protobuf.ExtensionRegistry registry) { 14 | registerAllExtensions( 15 | (com.google.protobuf.ExtensionRegistryLite) registry); 16 | } 17 | public interface HelloRequestOrBuilder extends 18 | // @@protoc_insertion_point(interface_extends:HelloRequest) 19 | com.google.protobuf.MessageOrBuilder { 20 | 21 | /** 22 | * string name = 1; 23 | */ 24 | java.lang.String getName(); 25 | /** 26 | * string name = 1; 27 | */ 28 | com.google.protobuf.ByteString 29 | getNameBytes(); 30 | } 31 | /** 32 | * Protobuf type {@code HelloRequest} 33 | */ 34 | public static final class HelloRequest extends 35 | com.google.protobuf.GeneratedMessageV3 implements 36 | // @@protoc_insertion_point(message_implements:HelloRequest) 37 | HelloRequestOrBuilder { 38 | private static final long serialVersionUID = 0L; 39 | // Use HelloRequest.newBuilder() to construct. 40 | private HelloRequest(com.google.protobuf.GeneratedMessageV3.Builder builder) { 41 | super(builder); 42 | } 43 | private HelloRequest() { 44 | name_ = ""; 45 | } 46 | 47 | @java.lang.Override 48 | public final com.google.protobuf.UnknownFieldSet 49 | getUnknownFields() { 50 | return this.unknownFields; 51 | } 52 | private HelloRequest( 53 | com.google.protobuf.CodedInputStream input, 54 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 55 | throws com.google.protobuf.InvalidProtocolBufferException { 56 | this(); 57 | if (extensionRegistry == null) { 58 | throw new java.lang.NullPointerException(); 59 | } 60 | int mutable_bitField0_ = 0; 61 | com.google.protobuf.UnknownFieldSet.Builder unknownFields = 62 | com.google.protobuf.UnknownFieldSet.newBuilder(); 63 | try { 64 | boolean done = false; 65 | while (!done) { 66 | int tag = input.readTag(); 67 | switch (tag) { 68 | case 0: 69 | done = true; 70 | break; 71 | case 10: { 72 | java.lang.String s = input.readStringRequireUtf8(); 73 | 74 | name_ = s; 75 | break; 76 | } 77 | default: { 78 | if (!parseUnknownFieldProto3( 79 | input, unknownFields, extensionRegistry, tag)) { 80 | done = true; 81 | } 82 | break; 83 | } 84 | } 85 | } 86 | } catch (com.google.protobuf.InvalidProtocolBufferException e) { 87 | throw e.setUnfinishedMessage(this); 88 | } catch (java.io.IOException e) { 89 | throw new com.google.protobuf.InvalidProtocolBufferException( 90 | e).setUnfinishedMessage(this); 91 | } finally { 92 | this.unknownFields = unknownFields.build(); 93 | makeExtensionsImmutable(); 94 | } 95 | } 96 | public static final com.google.protobuf.Descriptors.Descriptor 97 | getDescriptor() { 98 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.internal_static_HelloRequest_descriptor; 99 | } 100 | 101 | @java.lang.Override 102 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 103 | internalGetFieldAccessorTable() { 104 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.internal_static_HelloRequest_fieldAccessorTable 105 | .ensureFieldAccessorsInitialized( 106 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest.class, com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest.Builder.class); 107 | } 108 | 109 | public static final int NAME_FIELD_NUMBER = 1; 110 | private volatile java.lang.Object name_; 111 | /** 112 | * string name = 1; 113 | */ 114 | public java.lang.String getName() { 115 | java.lang.Object ref = name_; 116 | if (ref instanceof java.lang.String) { 117 | return (java.lang.String) ref; 118 | } else { 119 | com.google.protobuf.ByteString bs = 120 | (com.google.protobuf.ByteString) ref; 121 | java.lang.String s = bs.toStringUtf8(); 122 | name_ = s; 123 | return s; 124 | } 125 | } 126 | /** 127 | * string name = 1; 128 | */ 129 | public com.google.protobuf.ByteString 130 | getNameBytes() { 131 | java.lang.Object ref = name_; 132 | if (ref instanceof java.lang.String) { 133 | com.google.protobuf.ByteString b = 134 | com.google.protobuf.ByteString.copyFromUtf8( 135 | (java.lang.String) ref); 136 | name_ = b; 137 | return b; 138 | } else { 139 | return (com.google.protobuf.ByteString) ref; 140 | } 141 | } 142 | 143 | private byte memoizedIsInitialized = -1; 144 | @java.lang.Override 145 | public final boolean isInitialized() { 146 | byte isInitialized = memoizedIsInitialized; 147 | if (isInitialized == 1) return true; 148 | if (isInitialized == 0) return false; 149 | 150 | memoizedIsInitialized = 1; 151 | return true; 152 | } 153 | 154 | @java.lang.Override 155 | public void writeTo(com.google.protobuf.CodedOutputStream output) 156 | throws java.io.IOException { 157 | if (!getNameBytes().isEmpty()) { 158 | com.google.protobuf.GeneratedMessageV3.writeString(output, 1, name_); 159 | } 160 | unknownFields.writeTo(output); 161 | } 162 | 163 | @java.lang.Override 164 | public int getSerializedSize() { 165 | int size = memoizedSize; 166 | if (size != -1) return size; 167 | 168 | size = 0; 169 | if (!getNameBytes().isEmpty()) { 170 | size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, name_); 171 | } 172 | size += unknownFields.getSerializedSize(); 173 | memoizedSize = size; 174 | return size; 175 | } 176 | 177 | @java.lang.Override 178 | public boolean equals(final java.lang.Object obj) { 179 | if (obj == this) { 180 | return true; 181 | } 182 | if (!(obj instanceof com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest)) { 183 | return super.equals(obj); 184 | } 185 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest other = (com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest) obj; 186 | 187 | boolean result = true; 188 | result = result && getName() 189 | .equals(other.getName()); 190 | result = result && unknownFields.equals(other.unknownFields); 191 | return result; 192 | } 193 | 194 | @java.lang.Override 195 | public int hashCode() { 196 | if (memoizedHashCode != 0) { 197 | return memoizedHashCode; 198 | } 199 | int hash = 41; 200 | hash = (19 * hash) + getDescriptor().hashCode(); 201 | hash = (37 * hash) + NAME_FIELD_NUMBER; 202 | hash = (53 * hash) + getName().hashCode(); 203 | hash = (29 * hash) + unknownFields.hashCode(); 204 | memoizedHashCode = hash; 205 | return hash; 206 | } 207 | 208 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parseFrom( 209 | java.nio.ByteBuffer data) 210 | throws com.google.protobuf.InvalidProtocolBufferException { 211 | return PARSER.parseFrom(data); 212 | } 213 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parseFrom( 214 | java.nio.ByteBuffer data, 215 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 216 | throws com.google.protobuf.InvalidProtocolBufferException { 217 | return PARSER.parseFrom(data, extensionRegistry); 218 | } 219 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parseFrom( 220 | com.google.protobuf.ByteString data) 221 | throws com.google.protobuf.InvalidProtocolBufferException { 222 | return PARSER.parseFrom(data); 223 | } 224 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parseFrom( 225 | com.google.protobuf.ByteString data, 226 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 227 | throws com.google.protobuf.InvalidProtocolBufferException { 228 | return PARSER.parseFrom(data, extensionRegistry); 229 | } 230 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parseFrom(byte[] data) 231 | throws com.google.protobuf.InvalidProtocolBufferException { 232 | return PARSER.parseFrom(data); 233 | } 234 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parseFrom( 235 | byte[] data, 236 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 237 | throws com.google.protobuf.InvalidProtocolBufferException { 238 | return PARSER.parseFrom(data, extensionRegistry); 239 | } 240 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parseFrom(java.io.InputStream input) 241 | throws java.io.IOException { 242 | return com.google.protobuf.GeneratedMessageV3 243 | .parseWithIOException(PARSER, input); 244 | } 245 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parseFrom( 246 | java.io.InputStream input, 247 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 248 | throws java.io.IOException { 249 | return com.google.protobuf.GeneratedMessageV3 250 | .parseWithIOException(PARSER, input, extensionRegistry); 251 | } 252 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parseDelimitedFrom(java.io.InputStream input) 253 | throws java.io.IOException { 254 | return com.google.protobuf.GeneratedMessageV3 255 | .parseDelimitedWithIOException(PARSER, input); 256 | } 257 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parseDelimitedFrom( 258 | java.io.InputStream input, 259 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 260 | throws java.io.IOException { 261 | return com.google.protobuf.GeneratedMessageV3 262 | .parseDelimitedWithIOException(PARSER, input, extensionRegistry); 263 | } 264 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parseFrom( 265 | com.google.protobuf.CodedInputStream input) 266 | throws java.io.IOException { 267 | return com.google.protobuf.GeneratedMessageV3 268 | .parseWithIOException(PARSER, input); 269 | } 270 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parseFrom( 271 | com.google.protobuf.CodedInputStream input, 272 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 273 | throws java.io.IOException { 274 | return com.google.protobuf.GeneratedMessageV3 275 | .parseWithIOException(PARSER, input, extensionRegistry); 276 | } 277 | 278 | @java.lang.Override 279 | public Builder newBuilderForType() { return newBuilder(); } 280 | public static Builder newBuilder() { 281 | return DEFAULT_INSTANCE.toBuilder(); 282 | } 283 | public static Builder newBuilder(com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest prototype) { 284 | return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 285 | } 286 | @java.lang.Override 287 | public Builder toBuilder() { 288 | return this == DEFAULT_INSTANCE 289 | ? new Builder() : new Builder().mergeFrom(this); 290 | } 291 | 292 | @java.lang.Override 293 | protected Builder newBuilderForType( 294 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 295 | Builder builder = new Builder(parent); 296 | return builder; 297 | } 298 | /** 299 | * Protobuf type {@code HelloRequest} 300 | */ 301 | public static final class Builder extends 302 | com.google.protobuf.GeneratedMessageV3.Builder implements 303 | // @@protoc_insertion_point(builder_implements:HelloRequest) 304 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequestOrBuilder { 305 | public static final com.google.protobuf.Descriptors.Descriptor 306 | getDescriptor() { 307 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.internal_static_HelloRequest_descriptor; 308 | } 309 | 310 | @java.lang.Override 311 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 312 | internalGetFieldAccessorTable() { 313 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.internal_static_HelloRequest_fieldAccessorTable 314 | .ensureFieldAccessorsInitialized( 315 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest.class, com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest.Builder.class); 316 | } 317 | 318 | // Construct using com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest.newBuilder() 319 | private Builder() { 320 | maybeForceBuilderInitialization(); 321 | } 322 | 323 | private Builder( 324 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 325 | super(parent); 326 | maybeForceBuilderInitialization(); 327 | } 328 | private void maybeForceBuilderInitialization() { 329 | if (com.google.protobuf.GeneratedMessageV3 330 | .alwaysUseFieldBuilders) { 331 | } 332 | } 333 | @java.lang.Override 334 | public Builder clear() { 335 | super.clear(); 336 | name_ = ""; 337 | 338 | return this; 339 | } 340 | 341 | @java.lang.Override 342 | public com.google.protobuf.Descriptors.Descriptor 343 | getDescriptorForType() { 344 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.internal_static_HelloRequest_descriptor; 345 | } 346 | 347 | @java.lang.Override 348 | public com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest getDefaultInstanceForType() { 349 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest.getDefaultInstance(); 350 | } 351 | 352 | @java.lang.Override 353 | public com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest build() { 354 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest result = buildPartial(); 355 | if (!result.isInitialized()) { 356 | throw newUninitializedMessageException(result); 357 | } 358 | return result; 359 | } 360 | 361 | @java.lang.Override 362 | public com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest buildPartial() { 363 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest result = new com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest(this); 364 | result.name_ = name_; 365 | onBuilt(); 366 | return result; 367 | } 368 | 369 | @java.lang.Override 370 | public Builder clone() { 371 | return (Builder) super.clone(); 372 | } 373 | @java.lang.Override 374 | public Builder setField( 375 | com.google.protobuf.Descriptors.FieldDescriptor field, 376 | java.lang.Object value) { 377 | return (Builder) super.setField(field, value); 378 | } 379 | @java.lang.Override 380 | public Builder clearField( 381 | com.google.protobuf.Descriptors.FieldDescriptor field) { 382 | return (Builder) super.clearField(field); 383 | } 384 | @java.lang.Override 385 | public Builder clearOneof( 386 | com.google.protobuf.Descriptors.OneofDescriptor oneof) { 387 | return (Builder) super.clearOneof(oneof); 388 | } 389 | @java.lang.Override 390 | public Builder setRepeatedField( 391 | com.google.protobuf.Descriptors.FieldDescriptor field, 392 | int index, java.lang.Object value) { 393 | return (Builder) super.setRepeatedField(field, index, value); 394 | } 395 | @java.lang.Override 396 | public Builder addRepeatedField( 397 | com.google.protobuf.Descriptors.FieldDescriptor field, 398 | java.lang.Object value) { 399 | return (Builder) super.addRepeatedField(field, value); 400 | } 401 | @java.lang.Override 402 | public Builder mergeFrom(com.google.protobuf.Message other) { 403 | if (other instanceof com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest) { 404 | return mergeFrom((com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest)other); 405 | } else { 406 | super.mergeFrom(other); 407 | return this; 408 | } 409 | } 410 | 411 | public Builder mergeFrom(com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest other) { 412 | if (other == com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest.getDefaultInstance()) return this; 413 | if (!other.getName().isEmpty()) { 414 | name_ = other.name_; 415 | onChanged(); 416 | } 417 | this.mergeUnknownFields(other.unknownFields); 418 | onChanged(); 419 | return this; 420 | } 421 | 422 | @java.lang.Override 423 | public final boolean isInitialized() { 424 | return true; 425 | } 426 | 427 | @java.lang.Override 428 | public Builder mergeFrom( 429 | com.google.protobuf.CodedInputStream input, 430 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 431 | throws java.io.IOException { 432 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest parsedMessage = null; 433 | try { 434 | parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); 435 | } catch (com.google.protobuf.InvalidProtocolBufferException e) { 436 | parsedMessage = (com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest) e.getUnfinishedMessage(); 437 | throw e.unwrapIOException(); 438 | } finally { 439 | if (parsedMessage != null) { 440 | mergeFrom(parsedMessage); 441 | } 442 | } 443 | return this; 444 | } 445 | 446 | private java.lang.Object name_ = ""; 447 | /** 448 | * string name = 1; 449 | */ 450 | public java.lang.String getName() { 451 | java.lang.Object ref = name_; 452 | if (!(ref instanceof java.lang.String)) { 453 | com.google.protobuf.ByteString bs = 454 | (com.google.protobuf.ByteString) ref; 455 | java.lang.String s = bs.toStringUtf8(); 456 | name_ = s; 457 | return s; 458 | } else { 459 | return (java.lang.String) ref; 460 | } 461 | } 462 | /** 463 | * string name = 1; 464 | */ 465 | public com.google.protobuf.ByteString 466 | getNameBytes() { 467 | java.lang.Object ref = name_; 468 | if (ref instanceof String) { 469 | com.google.protobuf.ByteString b = 470 | com.google.protobuf.ByteString.copyFromUtf8( 471 | (java.lang.String) ref); 472 | name_ = b; 473 | return b; 474 | } else { 475 | return (com.google.protobuf.ByteString) ref; 476 | } 477 | } 478 | /** 479 | * string name = 1; 480 | */ 481 | public Builder setName( 482 | java.lang.String value) { 483 | if (value == null) { 484 | throw new NullPointerException(); 485 | } 486 | 487 | name_ = value; 488 | onChanged(); 489 | return this; 490 | } 491 | /** 492 | * string name = 1; 493 | */ 494 | public Builder clearName() { 495 | 496 | name_ = getDefaultInstance().getName(); 497 | onChanged(); 498 | return this; 499 | } 500 | /** 501 | * string name = 1; 502 | */ 503 | public Builder setNameBytes( 504 | com.google.protobuf.ByteString value) { 505 | if (value == null) { 506 | throw new NullPointerException(); 507 | } 508 | checkByteStringIsUtf8(value); 509 | 510 | name_ = value; 511 | onChanged(); 512 | return this; 513 | } 514 | @java.lang.Override 515 | public final Builder setUnknownFields( 516 | final com.google.protobuf.UnknownFieldSet unknownFields) { 517 | return super.setUnknownFieldsProto3(unknownFields); 518 | } 519 | 520 | @java.lang.Override 521 | public final Builder mergeUnknownFields( 522 | final com.google.protobuf.UnknownFieldSet unknownFields) { 523 | return super.mergeUnknownFields(unknownFields); 524 | } 525 | 526 | 527 | // @@protoc_insertion_point(builder_scope:HelloRequest) 528 | } 529 | 530 | // @@protoc_insertion_point(class_scope:HelloRequest) 531 | private static final com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest DEFAULT_INSTANCE; 532 | static { 533 | DEFAULT_INSTANCE = new com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest(); 534 | } 535 | 536 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest getDefaultInstance() { 537 | return DEFAULT_INSTANCE; 538 | } 539 | 540 | private static final com.google.protobuf.Parser 541 | PARSER = new com.google.protobuf.AbstractParser() { 542 | @java.lang.Override 543 | public HelloRequest parsePartialFrom( 544 | com.google.protobuf.CodedInputStream input, 545 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 546 | throws com.google.protobuf.InvalidProtocolBufferException { 547 | return new HelloRequest(input, extensionRegistry); 548 | } 549 | }; 550 | 551 | public static com.google.protobuf.Parser parser() { 552 | return PARSER; 553 | } 554 | 555 | @java.lang.Override 556 | public com.google.protobuf.Parser getParserForType() { 557 | return PARSER; 558 | } 559 | 560 | @java.lang.Override 561 | public com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloRequest getDefaultInstanceForType() { 562 | return DEFAULT_INSTANCE; 563 | } 564 | 565 | } 566 | 567 | public interface HelloReplyOrBuilder extends 568 | // @@protoc_insertion_point(interface_extends:HelloReply) 569 | com.google.protobuf.MessageOrBuilder { 570 | 571 | /** 572 | * string message = 1; 573 | */ 574 | java.lang.String getMessage(); 575 | /** 576 | * string message = 1; 577 | */ 578 | com.google.protobuf.ByteString 579 | getMessageBytes(); 580 | } 581 | /** 582 | * Protobuf type {@code HelloReply} 583 | */ 584 | public static final class HelloReply extends 585 | com.google.protobuf.GeneratedMessageV3 implements 586 | // @@protoc_insertion_point(message_implements:HelloReply) 587 | HelloReplyOrBuilder { 588 | private static final long serialVersionUID = 0L; 589 | // Use HelloReply.newBuilder() to construct. 590 | private HelloReply(com.google.protobuf.GeneratedMessageV3.Builder builder) { 591 | super(builder); 592 | } 593 | private HelloReply() { 594 | message_ = ""; 595 | } 596 | 597 | @java.lang.Override 598 | public final com.google.protobuf.UnknownFieldSet 599 | getUnknownFields() { 600 | return this.unknownFields; 601 | } 602 | private HelloReply( 603 | com.google.protobuf.CodedInputStream input, 604 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 605 | throws com.google.protobuf.InvalidProtocolBufferException { 606 | this(); 607 | if (extensionRegistry == null) { 608 | throw new java.lang.NullPointerException(); 609 | } 610 | int mutable_bitField0_ = 0; 611 | com.google.protobuf.UnknownFieldSet.Builder unknownFields = 612 | com.google.protobuf.UnknownFieldSet.newBuilder(); 613 | try { 614 | boolean done = false; 615 | while (!done) { 616 | int tag = input.readTag(); 617 | switch (tag) { 618 | case 0: 619 | done = true; 620 | break; 621 | case 10: { 622 | java.lang.String s = input.readStringRequireUtf8(); 623 | 624 | message_ = s; 625 | break; 626 | } 627 | default: { 628 | if (!parseUnknownFieldProto3( 629 | input, unknownFields, extensionRegistry, tag)) { 630 | done = true; 631 | } 632 | break; 633 | } 634 | } 635 | } 636 | } catch (com.google.protobuf.InvalidProtocolBufferException e) { 637 | throw e.setUnfinishedMessage(this); 638 | } catch (java.io.IOException e) { 639 | throw new com.google.protobuf.InvalidProtocolBufferException( 640 | e).setUnfinishedMessage(this); 641 | } finally { 642 | this.unknownFields = unknownFields.build(); 643 | makeExtensionsImmutable(); 644 | } 645 | } 646 | public static final com.google.protobuf.Descriptors.Descriptor 647 | getDescriptor() { 648 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.internal_static_HelloReply_descriptor; 649 | } 650 | 651 | @java.lang.Override 652 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 653 | internalGetFieldAccessorTable() { 654 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.internal_static_HelloReply_fieldAccessorTable 655 | .ensureFieldAccessorsInitialized( 656 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply.class, com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply.Builder.class); 657 | } 658 | 659 | public static final int MESSAGE_FIELD_NUMBER = 1; 660 | private volatile java.lang.Object message_; 661 | /** 662 | * string message = 1; 663 | */ 664 | public java.lang.String getMessage() { 665 | java.lang.Object ref = message_; 666 | if (ref instanceof java.lang.String) { 667 | return (java.lang.String) ref; 668 | } else { 669 | com.google.protobuf.ByteString bs = 670 | (com.google.protobuf.ByteString) ref; 671 | java.lang.String s = bs.toStringUtf8(); 672 | message_ = s; 673 | return s; 674 | } 675 | } 676 | /** 677 | * string message = 1; 678 | */ 679 | public com.google.protobuf.ByteString 680 | getMessageBytes() { 681 | java.lang.Object ref = message_; 682 | if (ref instanceof java.lang.String) { 683 | com.google.protobuf.ByteString b = 684 | com.google.protobuf.ByteString.copyFromUtf8( 685 | (java.lang.String) ref); 686 | message_ = b; 687 | return b; 688 | } else { 689 | return (com.google.protobuf.ByteString) ref; 690 | } 691 | } 692 | 693 | private byte memoizedIsInitialized = -1; 694 | @java.lang.Override 695 | public final boolean isInitialized() { 696 | byte isInitialized = memoizedIsInitialized; 697 | if (isInitialized == 1) return true; 698 | if (isInitialized == 0) return false; 699 | 700 | memoizedIsInitialized = 1; 701 | return true; 702 | } 703 | 704 | @java.lang.Override 705 | public void writeTo(com.google.protobuf.CodedOutputStream output) 706 | throws java.io.IOException { 707 | if (!getMessageBytes().isEmpty()) { 708 | com.google.protobuf.GeneratedMessageV3.writeString(output, 1, message_); 709 | } 710 | unknownFields.writeTo(output); 711 | } 712 | 713 | @java.lang.Override 714 | public int getSerializedSize() { 715 | int size = memoizedSize; 716 | if (size != -1) return size; 717 | 718 | size = 0; 719 | if (!getMessageBytes().isEmpty()) { 720 | size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, message_); 721 | } 722 | size += unknownFields.getSerializedSize(); 723 | memoizedSize = size; 724 | return size; 725 | } 726 | 727 | @java.lang.Override 728 | public boolean equals(final java.lang.Object obj) { 729 | if (obj == this) { 730 | return true; 731 | } 732 | if (!(obj instanceof com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply)) { 733 | return super.equals(obj); 734 | } 735 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply other = (com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply) obj; 736 | 737 | boolean result = true; 738 | result = result && getMessage() 739 | .equals(other.getMessage()); 740 | result = result && unknownFields.equals(other.unknownFields); 741 | return result; 742 | } 743 | 744 | @java.lang.Override 745 | public int hashCode() { 746 | if (memoizedHashCode != 0) { 747 | return memoizedHashCode; 748 | } 749 | int hash = 41; 750 | hash = (19 * hash) + getDescriptor().hashCode(); 751 | hash = (37 * hash) + MESSAGE_FIELD_NUMBER; 752 | hash = (53 * hash) + getMessage().hashCode(); 753 | hash = (29 * hash) + unknownFields.hashCode(); 754 | memoizedHashCode = hash; 755 | return hash; 756 | } 757 | 758 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parseFrom( 759 | java.nio.ByteBuffer data) 760 | throws com.google.protobuf.InvalidProtocolBufferException { 761 | return PARSER.parseFrom(data); 762 | } 763 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parseFrom( 764 | java.nio.ByteBuffer data, 765 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 766 | throws com.google.protobuf.InvalidProtocolBufferException { 767 | return PARSER.parseFrom(data, extensionRegistry); 768 | } 769 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parseFrom( 770 | com.google.protobuf.ByteString data) 771 | throws com.google.protobuf.InvalidProtocolBufferException { 772 | return PARSER.parseFrom(data); 773 | } 774 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parseFrom( 775 | com.google.protobuf.ByteString data, 776 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 777 | throws com.google.protobuf.InvalidProtocolBufferException { 778 | return PARSER.parseFrom(data, extensionRegistry); 779 | } 780 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parseFrom(byte[] data) 781 | throws com.google.protobuf.InvalidProtocolBufferException { 782 | return PARSER.parseFrom(data); 783 | } 784 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parseFrom( 785 | byte[] data, 786 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 787 | throws com.google.protobuf.InvalidProtocolBufferException { 788 | return PARSER.parseFrom(data, extensionRegistry); 789 | } 790 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parseFrom(java.io.InputStream input) 791 | throws java.io.IOException { 792 | return com.google.protobuf.GeneratedMessageV3 793 | .parseWithIOException(PARSER, input); 794 | } 795 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parseFrom( 796 | java.io.InputStream input, 797 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 798 | throws java.io.IOException { 799 | return com.google.protobuf.GeneratedMessageV3 800 | .parseWithIOException(PARSER, input, extensionRegistry); 801 | } 802 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parseDelimitedFrom(java.io.InputStream input) 803 | throws java.io.IOException { 804 | return com.google.protobuf.GeneratedMessageV3 805 | .parseDelimitedWithIOException(PARSER, input); 806 | } 807 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parseDelimitedFrom( 808 | java.io.InputStream input, 809 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 810 | throws java.io.IOException { 811 | return com.google.protobuf.GeneratedMessageV3 812 | .parseDelimitedWithIOException(PARSER, input, extensionRegistry); 813 | } 814 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parseFrom( 815 | com.google.protobuf.CodedInputStream input) 816 | throws java.io.IOException { 817 | return com.google.protobuf.GeneratedMessageV3 818 | .parseWithIOException(PARSER, input); 819 | } 820 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parseFrom( 821 | com.google.protobuf.CodedInputStream input, 822 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 823 | throws java.io.IOException { 824 | return com.google.protobuf.GeneratedMessageV3 825 | .parseWithIOException(PARSER, input, extensionRegistry); 826 | } 827 | 828 | @java.lang.Override 829 | public Builder newBuilderForType() { return newBuilder(); } 830 | public static Builder newBuilder() { 831 | return DEFAULT_INSTANCE.toBuilder(); 832 | } 833 | public static Builder newBuilder(com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply prototype) { 834 | return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); 835 | } 836 | @java.lang.Override 837 | public Builder toBuilder() { 838 | return this == DEFAULT_INSTANCE 839 | ? new Builder() : new Builder().mergeFrom(this); 840 | } 841 | 842 | @java.lang.Override 843 | protected Builder newBuilderForType( 844 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 845 | Builder builder = new Builder(parent); 846 | return builder; 847 | } 848 | /** 849 | * Protobuf type {@code HelloReply} 850 | */ 851 | public static final class Builder extends 852 | com.google.protobuf.GeneratedMessageV3.Builder implements 853 | // @@protoc_insertion_point(builder_implements:HelloReply) 854 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReplyOrBuilder { 855 | public static final com.google.protobuf.Descriptors.Descriptor 856 | getDescriptor() { 857 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.internal_static_HelloReply_descriptor; 858 | } 859 | 860 | @java.lang.Override 861 | protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 862 | internalGetFieldAccessorTable() { 863 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.internal_static_HelloReply_fieldAccessorTable 864 | .ensureFieldAccessorsInitialized( 865 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply.class, com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply.Builder.class); 866 | } 867 | 868 | // Construct using com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply.newBuilder() 869 | private Builder() { 870 | maybeForceBuilderInitialization(); 871 | } 872 | 873 | private Builder( 874 | com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { 875 | super(parent); 876 | maybeForceBuilderInitialization(); 877 | } 878 | private void maybeForceBuilderInitialization() { 879 | if (com.google.protobuf.GeneratedMessageV3 880 | .alwaysUseFieldBuilders) { 881 | } 882 | } 883 | @java.lang.Override 884 | public Builder clear() { 885 | super.clear(); 886 | message_ = ""; 887 | 888 | return this; 889 | } 890 | 891 | @java.lang.Override 892 | public com.google.protobuf.Descriptors.Descriptor 893 | getDescriptorForType() { 894 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.internal_static_HelloReply_descriptor; 895 | } 896 | 897 | @java.lang.Override 898 | public com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply getDefaultInstanceForType() { 899 | return com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply.getDefaultInstance(); 900 | } 901 | 902 | @java.lang.Override 903 | public com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply build() { 904 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply result = buildPartial(); 905 | if (!result.isInitialized()) { 906 | throw newUninitializedMessageException(result); 907 | } 908 | return result; 909 | } 910 | 911 | @java.lang.Override 912 | public com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply buildPartial() { 913 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply result = new com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply(this); 914 | result.message_ = message_; 915 | onBuilt(); 916 | return result; 917 | } 918 | 919 | @java.lang.Override 920 | public Builder clone() { 921 | return (Builder) super.clone(); 922 | } 923 | @java.lang.Override 924 | public Builder setField( 925 | com.google.protobuf.Descriptors.FieldDescriptor field, 926 | java.lang.Object value) { 927 | return (Builder) super.setField(field, value); 928 | } 929 | @java.lang.Override 930 | public Builder clearField( 931 | com.google.protobuf.Descriptors.FieldDescriptor field) { 932 | return (Builder) super.clearField(field); 933 | } 934 | @java.lang.Override 935 | public Builder clearOneof( 936 | com.google.protobuf.Descriptors.OneofDescriptor oneof) { 937 | return (Builder) super.clearOneof(oneof); 938 | } 939 | @java.lang.Override 940 | public Builder setRepeatedField( 941 | com.google.protobuf.Descriptors.FieldDescriptor field, 942 | int index, java.lang.Object value) { 943 | return (Builder) super.setRepeatedField(field, index, value); 944 | } 945 | @java.lang.Override 946 | public Builder addRepeatedField( 947 | com.google.protobuf.Descriptors.FieldDescriptor field, 948 | java.lang.Object value) { 949 | return (Builder) super.addRepeatedField(field, value); 950 | } 951 | @java.lang.Override 952 | public Builder mergeFrom(com.google.protobuf.Message other) { 953 | if (other instanceof com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply) { 954 | return mergeFrom((com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply)other); 955 | } else { 956 | super.mergeFrom(other); 957 | return this; 958 | } 959 | } 960 | 961 | public Builder mergeFrom(com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply other) { 962 | if (other == com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply.getDefaultInstance()) return this; 963 | if (!other.getMessage().isEmpty()) { 964 | message_ = other.message_; 965 | onChanged(); 966 | } 967 | this.mergeUnknownFields(other.unknownFields); 968 | onChanged(); 969 | return this; 970 | } 971 | 972 | @java.lang.Override 973 | public final boolean isInitialized() { 974 | return true; 975 | } 976 | 977 | @java.lang.Override 978 | public Builder mergeFrom( 979 | com.google.protobuf.CodedInputStream input, 980 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 981 | throws java.io.IOException { 982 | com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply parsedMessage = null; 983 | try { 984 | parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry); 985 | } catch (com.google.protobuf.InvalidProtocolBufferException e) { 986 | parsedMessage = (com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply) e.getUnfinishedMessage(); 987 | throw e.unwrapIOException(); 988 | } finally { 989 | if (parsedMessage != null) { 990 | mergeFrom(parsedMessage); 991 | } 992 | } 993 | return this; 994 | } 995 | 996 | private java.lang.Object message_ = ""; 997 | /** 998 | * string message = 1; 999 | */ 1000 | public java.lang.String getMessage() { 1001 | java.lang.Object ref = message_; 1002 | if (!(ref instanceof java.lang.String)) { 1003 | com.google.protobuf.ByteString bs = 1004 | (com.google.protobuf.ByteString) ref; 1005 | java.lang.String s = bs.toStringUtf8(); 1006 | message_ = s; 1007 | return s; 1008 | } else { 1009 | return (java.lang.String) ref; 1010 | } 1011 | } 1012 | /** 1013 | * string message = 1; 1014 | */ 1015 | public com.google.protobuf.ByteString 1016 | getMessageBytes() { 1017 | java.lang.Object ref = message_; 1018 | if (ref instanceof String) { 1019 | com.google.protobuf.ByteString b = 1020 | com.google.protobuf.ByteString.copyFromUtf8( 1021 | (java.lang.String) ref); 1022 | message_ = b; 1023 | return b; 1024 | } else { 1025 | return (com.google.protobuf.ByteString) ref; 1026 | } 1027 | } 1028 | /** 1029 | * string message = 1; 1030 | */ 1031 | public Builder setMessage( 1032 | java.lang.String value) { 1033 | if (value == null) { 1034 | throw new NullPointerException(); 1035 | } 1036 | 1037 | message_ = value; 1038 | onChanged(); 1039 | return this; 1040 | } 1041 | /** 1042 | * string message = 1; 1043 | */ 1044 | public Builder clearMessage() { 1045 | 1046 | message_ = getDefaultInstance().getMessage(); 1047 | onChanged(); 1048 | return this; 1049 | } 1050 | /** 1051 | * string message = 1; 1052 | */ 1053 | public Builder setMessageBytes( 1054 | com.google.protobuf.ByteString value) { 1055 | if (value == null) { 1056 | throw new NullPointerException(); 1057 | } 1058 | checkByteStringIsUtf8(value); 1059 | 1060 | message_ = value; 1061 | onChanged(); 1062 | return this; 1063 | } 1064 | @java.lang.Override 1065 | public final Builder setUnknownFields( 1066 | final com.google.protobuf.UnknownFieldSet unknownFields) { 1067 | return super.setUnknownFieldsProto3(unknownFields); 1068 | } 1069 | 1070 | @java.lang.Override 1071 | public final Builder mergeUnknownFields( 1072 | final com.google.protobuf.UnknownFieldSet unknownFields) { 1073 | return super.mergeUnknownFields(unknownFields); 1074 | } 1075 | 1076 | 1077 | // @@protoc_insertion_point(builder_scope:HelloReply) 1078 | } 1079 | 1080 | // @@protoc_insertion_point(class_scope:HelloReply) 1081 | private static final com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply DEFAULT_INSTANCE; 1082 | static { 1083 | DEFAULT_INSTANCE = new com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply(); 1084 | } 1085 | 1086 | public static com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply getDefaultInstance() { 1087 | return DEFAULT_INSTANCE; 1088 | } 1089 | 1090 | private static final com.google.protobuf.Parser 1091 | PARSER = new com.google.protobuf.AbstractParser() { 1092 | @java.lang.Override 1093 | public HelloReply parsePartialFrom( 1094 | com.google.protobuf.CodedInputStream input, 1095 | com.google.protobuf.ExtensionRegistryLite extensionRegistry) 1096 | throws com.google.protobuf.InvalidProtocolBufferException { 1097 | return new HelloReply(input, extensionRegistry); 1098 | } 1099 | }; 1100 | 1101 | public static com.google.protobuf.Parser parser() { 1102 | return PARSER; 1103 | } 1104 | 1105 | @java.lang.Override 1106 | public com.google.protobuf.Parser getParserForType() { 1107 | return PARSER; 1108 | } 1109 | 1110 | @java.lang.Override 1111 | public com.linshen.grpc.cloud.lib.GreeterOuterClass.HelloReply getDefaultInstanceForType() { 1112 | return DEFAULT_INSTANCE; 1113 | } 1114 | 1115 | } 1116 | 1117 | private static final com.google.protobuf.Descriptors.Descriptor 1118 | internal_static_HelloRequest_descriptor; 1119 | private static final 1120 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 1121 | internal_static_HelloRequest_fieldAccessorTable; 1122 | private static final com.google.protobuf.Descriptors.Descriptor 1123 | internal_static_HelloReply_descriptor; 1124 | private static final 1125 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable 1126 | internal_static_HelloReply_fieldAccessorTable; 1127 | 1128 | public static com.google.protobuf.Descriptors.FileDescriptor 1129 | getDescriptor() { 1130 | return descriptor; 1131 | } 1132 | private static com.google.protobuf.Descriptors.FileDescriptor 1133 | descriptor; 1134 | static { 1135 | java.lang.String[] descriptorData = { 1136 | "\n\rgreeter.proto\"\034\n\014HelloRequest\022\014\n\004name\030" + 1137 | "\001 \001(\t\"\035\n\nHelloReply\022\017\n\007message\030\001 \001(\t23\n\007" + 1138 | "Greeter\022(\n\010SayHello\022\r.HelloRequest\032\013.Hel" + 1139 | "loReply\"\000B\034\n\032com.linshen.grpc.cloud.libb" + 1140 | "\006proto3" 1141 | }; 1142 | com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner = 1143 | new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() { 1144 | public com.google.protobuf.ExtensionRegistry assignDescriptors( 1145 | com.google.protobuf.Descriptors.FileDescriptor root) { 1146 | descriptor = root; 1147 | return null; 1148 | } 1149 | }; 1150 | com.google.protobuf.Descriptors.FileDescriptor 1151 | .internalBuildGeneratedFileFrom(descriptorData, 1152 | new com.google.protobuf.Descriptors.FileDescriptor[] { 1153 | }, assigner); 1154 | internal_static_HelloRequest_descriptor = 1155 | getDescriptor().getMessageTypes().get(0); 1156 | internal_static_HelloRequest_fieldAccessorTable = new 1157 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( 1158 | internal_static_HelloRequest_descriptor, 1159 | new java.lang.String[] { "Name", }); 1160 | internal_static_HelloReply_descriptor = 1161 | getDescriptor().getMessageTypes().get(1); 1162 | internal_static_HelloReply_fieldAccessorTable = new 1163 | com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( 1164 | internal_static_HelloReply_descriptor, 1165 | new java.lang.String[] { "Message", }); 1166 | } 1167 | 1168 | // @@protoc_insertion_point(outer_class_scope) 1169 | } 1170 | --------------------------------------------------------------------------------