examples: Provide Maven and Gradle build files

The examples are no longer part of the normal build, although they are
built with Travis. The examples now include their own copy of the gradle
wrapper to ease usage from IDEs which can now properly detect the
correct version of gradle to use.

The build files were generated using "gradle init" and "mvn
archetype:generate" and then modified following our README.

Fixes #1414
This commit is contained in:
Eric Anderson 2016-06-24 18:18:06 -07:00
parent 3c03eb79ec
commit d7bf67e01f
37 changed files with 703 additions and 5982 deletions

3
.gitignore vendored
View File

@ -4,6 +4,9 @@ gradle.properties
.gradle
local.properties
# Maven (examples)
target
# IntelliJ IDEA
.idea
*.iml

View File

@ -24,7 +24,9 @@ before_install:
- echo "failOnWarnings=true" >> $HOME/.gradle/gradle.properties
install:
- ./gradlew assemble generateTestProto
- ./gradlew assemble generateTestProto install
- pushd examples && ./gradlew build && popd
- pushd examples && mvn verify && popd
before_script:
- test -z "$(git status --porcelain)" || (git status && echo Error Working directory is not clean. Forget to commit generated files? && false)

View File

@ -77,6 +77,7 @@ would be used to create all `v0.7` tags (e.g. `v0.7.0`, `v0.7.1`).
# Change version to next minor (and keep -SNAPSHOT)
$ sed -i 's/[0-9]\+\.[0-9]\+\.[0-9]\+\(.*CURRENT_GRPC_VERSION\)/'$MAJOR.$((MINOR+1)).0'\1/' \
build.gradle android-interop-testing/app/build.gradle \
examples/build.gradle examples/pom.xml \
examples/android/app/build.gradle
$ ./gradlew build
$ git commit -a -m "Start $MAJOR.$((MINOR+1)).0 development cycle"
@ -96,6 +97,7 @@ would be used to create all `v0.7` tags (e.g. `v0.7.0`, `v0.7.1`).
# Change version to remove -SNAPSHOT
$ sed -i 's/-SNAPSHOT\(.*CURRENT_GRPC_VERSION\)/\1/' \
build.gradle android-interop-testing/app/build.gradle \
examples/build.gradle examples/pom.xml \
examples/android/app/build.gradle
$ ./gradlew build
$ git commit -a -m "Bump version to $MAJOR.$MINOR.$PATCH"
@ -108,6 +110,7 @@ would be used to create all `v0.7` tags (e.g. `v0.7.0`, `v0.7.1`).
# Change version to next patch and add -SNAPSHOT
$ sed -i 's/[0-9]\+\.[0-9]\+\.[0-9]\+\(.*CURRENT_GRPC_VERSION\)/'$MAJOR.$MINOR.$((PATCH+1))-SNAPSHOT'\1/' \
build.gradle android-interop-testing/app/build.gradle \
examples/build.gradle examples/pom.xml \
examples/android/app/build.gradle
$ ./gradlew build
$ git commit -a -m "Bump version to $MAJOR.$MINOR.$((PATCH+1))-SNAPSHOT"

View File

@ -1,10 +1,14 @@
grpc Examples
==============================================
The examples require grpc-java to already be built. You are strongly encouraged
to check out a git release tag, since there will already be a build of grpc
available. Otherwise you must follow [COMPILING](../COMPILING.md).
To build the examples, run in this directory:
```
$ ../gradlew installDist -PskipCodegen=true
$ ./gradlew installDist
```
This creates the scripts `hello-world-server`, `hello-world-client`,
@ -29,3 +33,14 @@ That's it!
Please refer to gRPC Java's [README](../README.md) and
[tutorial](http://www.grpc.io/docs/tutorials/basic/java.html) for more
information.
## Maven
If you prefer to use Maven:
```
$ mvn verify
$ # Run the server
$ mvn exec:java -Dexec.mainClass=io.grpc.examples.helloworld.HelloWorldServer
$ # In another terminal run the client
$ mvn exec:java -Dexec.mainClass=io.grpc.examples.helloworld.HelloWorldClient
```

View File

@ -25,5 +25,5 @@ $ ./gradlew install -PskipCodegen=true
**3. Install the app**
```sh
$ cd examples/android
$ ../../gradlew installDebug
$ ./gradlew installDebug
```

Binary file not shown.

View File

@ -0,0 +1,6 @@
#Sat May 07 11:11:12 PDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip

164
examples/android/gradlew vendored Executable file
View File

@ -0,0 +1,164 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

90
examples/android/gradlew.bat vendored Normal file
View File

@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

View File

@ -1,87 +1,111 @@
// Don't consider this build file part of the example! It is much more complex
// than yours needs to be. For your own build file, please follow ../README.md
// instead. For a starting point you can make a build.gradle file with:
//
// apply plugin: 'java'
// repositories {
// mavenCentral()
// }
//
// Then copy the snippets from README.md.
apply plugin: 'java'
apply plugin: 'com.google.protobuf'
buildscript {
repositories {
mavenCentral()
}
dependencies {
// ASSUMES GRADLE 2.12 OR HIGHER. Use plugin version 0.7.5 with earlier
// gradle versions
classpath 'com.google.protobuf:protobuf-gradle-plugin:0.7.7'
}
}
repositories {
mavenCentral()
mavenLocal()
}
// IMPORTANT: You probably want the non-SNAPSHOT version of gRPC. Make sure you
// are looking at a tagged version of the example and not "master"!
// Feel free to delete the comment at the next line. It is just for safely
// updating the version in our release process.
def grpcVersion = '1.0.0-SNAPSHOT' // CURRENT_GRPC_VERSION
dependencies {
compile "io.grpc:grpc-netty:${grpcVersion}"
compile "io.grpc:grpc-protobuf:${grpcVersion}"
compile "io.grpc:grpc-stub:${grpcVersion}"
}
protobuf {
protoc {
// The version of protoc must match protobuf-java. If you don't depend on
// protobuf-java directly, you will be transitively depending on the
// protobuf-java version that grpc depends on.
artifact = 'com.google.protobuf:protoc:3.0.0-beta-3'
}
plugins {
grpc {
artifact = "io.grpc:protoc-gen-grpc-java:${grpcVersion}"
}
}
generateProtoTasks {
all()*.plugins {
grpc {}
}
}
}
// Inform IntelliJ projects about the generated code.
apply plugin: 'idea'
idea {
module {
// Not using generatedSourceDirs because of
// https://discuss.gradle.org/t/support-for-intellij-2016/15294/8
sourceDirs += file("${projectDir}/build/generated/source/proto/main/java");
sourceDirs += file("${projectDir}/build/generated/source/proto/main/grpc");
}
}
// Provide convenience executables for trying out the examples.
apply plugin: 'application'
description = "grpc Examples"
startScripts.enabled = false
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath libraries.protobuf_plugin
}
}
dependencies {
compile project(':grpc-core'),
project(':grpc-netty'),
project(':grpc-protobuf'),
project(':grpc-stub'),
libraries.protobuf_util
}
configureProtoCompilation()
task routeGuideServer(type: CreateStartScripts) {
mainClassName = "io.grpc.examples.routeguide.RouteGuideServer"
applicationName = "route-guide-server"
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
mainClassName = 'io.grpc.examples.routeguide.RouteGuideServer'
applicationName = 'route-guide-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task routeGuideClient(type: CreateStartScripts) {
mainClassName = "io.grpc.examples.routeguide.RouteGuideClient"
applicationName = "route-guide-client"
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
mainClassName = 'io.grpc.examples.routeguide.RouteGuideClient'
applicationName = 'route-guide-client'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task helloWorldServer(type: CreateStartScripts) {
mainClassName = "io.grpc.examples.helloworld.HelloWorldServer"
applicationName = "hello-world-server"
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
mainClassName = 'io.grpc.examples.helloworld.HelloWorldServer'
applicationName = 'hello-world-server'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task helloWorldClient(type: CreateStartScripts) {
mainClassName = "io.grpc.examples.helloworld.HelloWorldClient"
applicationName = "hello-world-client"
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
mainClassName = 'io.grpc.examples.helloworld.HelloWorldClient'
applicationName = 'hello-world-client'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
task compressingHelloWorldClient(type: CreateStartScripts) {
mainClassName = "io.grpc.examples.experimental.CompressingHelloWorldClient"
applicationName = "compressing-hello-world-client"
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
mainClassName = 'io.grpc.examples.experimental.CompressingHelloWorldClient'
applicationName = 'compressing-hello-world-client'
outputDir = new File(project.buildDir, 'tmp')
classpath = jar.outputs.files + project.configurations.runtime
}
applicationDistribution.into("bin") {
from(routeGuideServer)
from(routeGuideClient)
from(helloWorldServer)
from(helloWorldClient)
from(compressingHelloWorldClient)
fileMode = 0755
}
// Let intellij projects refer to generated code
idea {
module {
sourceDirs += file("${projectDir}/src/generated/main/java");
sourceDirs += file("${projectDir}/src/generated/main/grpc");
}
applicationDistribution.into('bin') {
from(routeGuideServer)
from(routeGuideClient)
from(helloWorldServer)
from(helloWorldClient)
from(compressingHelloWorldClient)
fileMode = 0755
}

Binary file not shown.

View File

@ -0,0 +1,6 @@
#Sat May 07 11:11:12 PDT 2016
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.13-bin.zip

164
examples/gradlew vendored Executable file
View File

@ -0,0 +1,164 @@
#!/usr/bin/env bash
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS=""
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn ( ) {
echo "$*"
}
die ( ) {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin, switch paths to Windows format before running java
if $cygwin ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=$((i+1))
done
case $i in
(0) set -- ;;
(1) set -- "$args0" ;;
(2) set -- "$args0" "$args1" ;;
(3) set -- "$args0" "$args1" "$args2" ;;
(4) set -- "$args0" "$args1" "$args2" "$args3" ;;
(5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
(6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
(7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
(8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
(9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
function splitJvmOpts() {
JVM_OPTS=("$@")
}
eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"

90
examples/gradlew.bat vendored Normal file
View File

@ -0,0 +1,90 @@
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS=
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto init
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto init
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:init
@rem Get command-line arguments, handling Windows variants
if not "%OS%" == "Windows_NT" goto win9xME_args
if "%@eval[2+2]" == "4" goto 4NT_args
:win9xME_args
@rem Slurp the command line arguments.
set CMD_LINE_ARGS=
set _SKIP=2
:win9xME_args_slurp
if "x%~1" == "x" goto execute
set CMD_LINE_ARGS=%*
goto execute
:4NT_args
@rem Get arguments from the 4NT Shell from JP Software
set CMD_LINE_ARGS=%$
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega

66
examples/pom.xml Normal file
View File

@ -0,0 +1,66 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>io.grpc</groupId>
<artifactId>examples</artifactId>
<packaging>jar</packaging>
<!-- Feel free to delete the comment at the end of these lines. It is just
for safely updating the version in our release process. -->
<version>1.0.0-SNAPSHOT</version><!-- CURRENT_GRPC_VERSION -->
<name>examples</name>
<url>http://maven.apache.org</url>
<properties>
<grpc.version>1.0.0-SNAPSHOT</grpc.version><!-- CURRENT_GRPC_VERSION -->
</properties>
<dependencies>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-netty</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-protobuf</artifactId>
<version>${grpc.version}</version>
</dependency>
<dependency>
<groupId>io.grpc</groupId>
<artifactId>grpc-stub</artifactId>
<version>${grpc.version}</version>
</dependency>
</dependencies>
<build>
<extensions>
<extension>
<groupId>kr.motd.maven</groupId>
<artifactId>os-maven-plugin</artifactId>
<version>1.4.1.Final</version>
</extension>
</extensions>
<plugins>
<plugin>
<groupId>org.xolstice.maven.plugins</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.0</version>
<configuration>
<!--
The version of protoc must match protobuf-java. If you don't depend on
protobuf-java directly, you will be transitively depending on the
protobuf-java version that grpc depends on.
-->
<protocArtifact>com.google.protobuf:protoc:3.0.0-beta-3:exe:${os.detected.classifier}</protocArtifact>
<pluginId>grpc-java</pluginId>
<pluginArtifact>io.grpc:protoc-gen-grpc-java:${grpc.version}:exe:${os.detected.classifier}</pluginArtifact>
</configuration>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>compile-custom</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>

1
examples/settings.gradle Normal file
View File

@ -0,0 +1 @@
rootProject.name = 'examples'

View File

@ -1,259 +0,0 @@
package io.grpc.examples.helloworld;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
/**
* <pre>
* The greeting service definition.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.0.0-SNAPSHOT)",
comments = "Source: helloworld.proto")
public class GreeterGrpc {
private GreeterGrpc() {}
public static final String SERVICE_NAME = "helloworld.Greeter";
// Static method descriptors that strictly reflect the proto.
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor<io.grpc.examples.helloworld.HelloRequest,
io.grpc.examples.helloworld.HelloReply> METHOD_SAY_HELLO =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"helloworld.Greeter", "SayHello"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloRequest.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.helloworld.HelloReply.getDefaultInstance()));
/**
* Creates a new async stub that supports all call types for the service
*/
public static GreeterStub newStub(io.grpc.Channel channel) {
return new GreeterStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static GreeterBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new GreeterBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service
*/
public static GreeterFutureStub newFutureStub(
io.grpc.Channel channel) {
return new GreeterFutureStub(channel);
}
/**
* <pre>
* The greeting service definition.
* </pre>
*/
@java.lang.Deprecated public static interface Greeter {
/**
* <pre>
* Sends a greeting
* </pre>
*/
public void sayHello(io.grpc.examples.helloworld.HelloRequest request,
io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloReply> responseObserver);
}
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1469")
public static abstract class GreeterImplBase implements Greeter, io.grpc.BindableService {
@java.lang.Override
public void sayHello(io.grpc.examples.helloworld.HelloRequest request,
io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloReply> responseObserver) {
asyncUnimplementedUnaryCall(METHOD_SAY_HELLO, responseObserver);
}
@java.lang.Override public io.grpc.ServerServiceDefinition bindService() {
return GreeterGrpc.bindService(this);
}
}
/**
* <pre>
* The greeting service definition.
* </pre>
*/
@java.lang.Deprecated public static interface GreeterBlockingClient {
/**
* <pre>
* Sends a greeting
* </pre>
*/
public io.grpc.examples.helloworld.HelloReply sayHello(io.grpc.examples.helloworld.HelloRequest request);
}
/**
* <pre>
* The greeting service definition.
* </pre>
*/
@java.lang.Deprecated public static interface GreeterFutureClient {
/**
* <pre>
* Sends a greeting
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.helloworld.HelloReply> sayHello(
io.grpc.examples.helloworld.HelloRequest request);
}
public static class GreeterStub extends io.grpc.stub.AbstractStub<GreeterStub>
implements Greeter {
private GreeterStub(io.grpc.Channel channel) {
super(channel);
}
private GreeterStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected GreeterStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new GreeterStub(channel, callOptions);
}
@java.lang.Override
public void sayHello(io.grpc.examples.helloworld.HelloRequest request,
io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloReply> responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_SAY_HELLO, getCallOptions()), request, responseObserver);
}
}
public static class GreeterBlockingStub extends io.grpc.stub.AbstractStub<GreeterBlockingStub>
implements GreeterBlockingClient {
private GreeterBlockingStub(io.grpc.Channel channel) {
super(channel);
}
private GreeterBlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected GreeterBlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new GreeterBlockingStub(channel, callOptions);
}
@java.lang.Override
public io.grpc.examples.helloworld.HelloReply sayHello(io.grpc.examples.helloworld.HelloRequest request) {
return blockingUnaryCall(
getChannel(), METHOD_SAY_HELLO, getCallOptions(), request);
}
}
public static class GreeterFutureStub extends io.grpc.stub.AbstractStub<GreeterFutureStub>
implements GreeterFutureClient {
private GreeterFutureStub(io.grpc.Channel channel) {
super(channel);
}
private GreeterFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected GreeterFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new GreeterFutureStub(channel, callOptions);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.helloworld.HelloReply> sayHello(
io.grpc.examples.helloworld.HelloRequest request) {
return futureUnaryCall(
getChannel().newCall(METHOD_SAY_HELLO, getCallOptions()), request);
}
}
@java.lang.Deprecated public static abstract class AbstractGreeter extends GreeterImplBase {}
private static final int METHODID_SAY_HELLO = 0;
private static class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
private final Greeter serviceImpl;
private final int methodId;
public MethodHandlers(Greeter serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
case METHODID_SAY_HELLO:
serviceImpl.sayHello((io.grpc.examples.helloworld.HelloRequest) request,
(io.grpc.stub.StreamObserver<io.grpc.examples.helloworld.HelloReply>) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver<Req> invoke(
io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
default:
throw new AssertionError();
}
}
}
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
return new io.grpc.ServiceDescriptor(SERVICE_NAME,
METHOD_SAY_HELLO);
}
@java.lang.Deprecated public static io.grpc.ServerServiceDefinition bindService(
final Greeter serviceImpl) {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
METHOD_SAY_HELLO,
asyncUnaryCall(
new MethodHandlers<
io.grpc.examples.helloworld.HelloRequest,
io.grpc.examples.helloworld.HelloReply>(
serviceImpl, METHODID_SAY_HELLO)))
.build();
}
}

View File

@ -1,422 +0,0 @@
package io.grpc.examples.routeguide;
import static io.grpc.stub.ClientCalls.asyncUnaryCall;
import static io.grpc.stub.ClientCalls.asyncServerStreamingCall;
import static io.grpc.stub.ClientCalls.asyncClientStreamingCall;
import static io.grpc.stub.ClientCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ClientCalls.blockingUnaryCall;
import static io.grpc.stub.ClientCalls.blockingServerStreamingCall;
import static io.grpc.stub.ClientCalls.futureUnaryCall;
import static io.grpc.MethodDescriptor.generateFullMethodName;
import static io.grpc.stub.ServerCalls.asyncUnaryCall;
import static io.grpc.stub.ServerCalls.asyncServerStreamingCall;
import static io.grpc.stub.ServerCalls.asyncClientStreamingCall;
import static io.grpc.stub.ServerCalls.asyncBidiStreamingCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedUnaryCall;
import static io.grpc.stub.ServerCalls.asyncUnimplementedStreamingCall;
/**
* <pre>
* Interface exported by the server.
* </pre>
*/
@javax.annotation.Generated(
value = "by gRPC proto compiler (version 1.0.0-SNAPSHOT)",
comments = "Source: route_guide.proto")
public class RouteGuideGrpc {
private RouteGuideGrpc() {}
public static final String SERVICE_NAME = "routeguide.RouteGuide";
// Static method descriptors that strictly reflect the proto.
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor<io.grpc.examples.routeguide.Point,
io.grpc.examples.routeguide.Feature> METHOD_GET_FEATURE =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.UNARY,
generateFullMethodName(
"routeguide.RouteGuide", "GetFeature"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Point.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Feature.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor<io.grpc.examples.routeguide.Rectangle,
io.grpc.examples.routeguide.Feature> METHOD_LIST_FEATURES =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.SERVER_STREAMING,
generateFullMethodName(
"routeguide.RouteGuide", "ListFeatures"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Rectangle.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Feature.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor<io.grpc.examples.routeguide.Point,
io.grpc.examples.routeguide.RouteSummary> METHOD_RECORD_ROUTE =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.CLIENT_STREAMING,
generateFullMethodName(
"routeguide.RouteGuide", "RecordRoute"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.Point.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.RouteSummary.getDefaultInstance()));
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1901")
public static final io.grpc.MethodDescriptor<io.grpc.examples.routeguide.RouteNote,
io.grpc.examples.routeguide.RouteNote> METHOD_ROUTE_CHAT =
io.grpc.MethodDescriptor.create(
io.grpc.MethodDescriptor.MethodType.BIDI_STREAMING,
generateFullMethodName(
"routeguide.RouteGuide", "RouteChat"),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.RouteNote.getDefaultInstance()),
io.grpc.protobuf.ProtoUtils.marshaller(io.grpc.examples.routeguide.RouteNote.getDefaultInstance()));
/**
* Creates a new async stub that supports all call types for the service
*/
public static RouteGuideStub newStub(io.grpc.Channel channel) {
return new RouteGuideStub(channel);
}
/**
* Creates a new blocking-style stub that supports unary and streaming output calls on the service
*/
public static RouteGuideBlockingStub newBlockingStub(
io.grpc.Channel channel) {
return new RouteGuideBlockingStub(channel);
}
/**
* Creates a new ListenableFuture-style stub that supports unary and streaming output calls on the service
*/
public static RouteGuideFutureStub newFutureStub(
io.grpc.Channel channel) {
return new RouteGuideFutureStub(channel);
}
/**
* <pre>
* Interface exported by the server.
* </pre>
*/
@java.lang.Deprecated public static interface RouteGuide {
/**
* <pre>
* A simple RPC.
* Obtains the feature at a given position.
* A feature with an empty name is returned if there's no feature at the given
* position.
* </pre>
*/
public void getFeature(io.grpc.examples.routeguide.Point request,
io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.Feature> responseObserver);
/**
* <pre>
* A server-to-client streaming RPC.
* Obtains the Features available within the given Rectangle. Results are
* streamed rather than returned at once (e.g. in a response message with a
* repeated field), as the rectangle may cover a large area and contain a
* huge number of features.
* </pre>
*/
public void listFeatures(io.grpc.examples.routeguide.Rectangle request,
io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.Feature> responseObserver);
/**
* <pre>
* A client-to-server streaming RPC.
* Accepts a stream of Points on a route being traversed, returning a
* RouteSummary when traversal is completed.
* </pre>
*/
public io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.Point> recordRoute(
io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteSummary> responseObserver);
/**
* <pre>
* A Bidirectional streaming RPC.
* Accepts a stream of RouteNotes sent while a route is being traversed,
* while receiving other RouteNotes (e.g. from other users).
* </pre>
*/
public io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteNote> routeChat(
io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteNote> responseObserver);
}
@io.grpc.ExperimentalApi("https://github.com/grpc/grpc-java/issues/1469")
public static abstract class RouteGuideImplBase implements RouteGuide, io.grpc.BindableService {
@java.lang.Override
public void getFeature(io.grpc.examples.routeguide.Point request,
io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.Feature> responseObserver) {
asyncUnimplementedUnaryCall(METHOD_GET_FEATURE, responseObserver);
}
@java.lang.Override
public void listFeatures(io.grpc.examples.routeguide.Rectangle request,
io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.Feature> responseObserver) {
asyncUnimplementedUnaryCall(METHOD_LIST_FEATURES, responseObserver);
}
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.Point> recordRoute(
io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteSummary> responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_RECORD_ROUTE, responseObserver);
}
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteNote> routeChat(
io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteNote> responseObserver) {
return asyncUnimplementedStreamingCall(METHOD_ROUTE_CHAT, responseObserver);
}
@java.lang.Override public io.grpc.ServerServiceDefinition bindService() {
return RouteGuideGrpc.bindService(this);
}
}
/**
* <pre>
* Interface exported by the server.
* </pre>
*/
@java.lang.Deprecated public static interface RouteGuideBlockingClient {
/**
* <pre>
* A simple RPC.
* Obtains the feature at a given position.
* A feature with an empty name is returned if there's no feature at the given
* position.
* </pre>
*/
public io.grpc.examples.routeguide.Feature getFeature(io.grpc.examples.routeguide.Point request);
/**
* <pre>
* A server-to-client streaming RPC.
* Obtains the Features available within the given Rectangle. Results are
* streamed rather than returned at once (e.g. in a response message with a
* repeated field), as the rectangle may cover a large area and contain a
* huge number of features.
* </pre>
*/
public java.util.Iterator<io.grpc.examples.routeguide.Feature> listFeatures(
io.grpc.examples.routeguide.Rectangle request);
}
/**
* <pre>
* Interface exported by the server.
* </pre>
*/
@java.lang.Deprecated public static interface RouteGuideFutureClient {
/**
* <pre>
* A simple RPC.
* Obtains the feature at a given position.
* A feature with an empty name is returned if there's no feature at the given
* position.
* </pre>
*/
public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.routeguide.Feature> getFeature(
io.grpc.examples.routeguide.Point request);
}
public static class RouteGuideStub extends io.grpc.stub.AbstractStub<RouteGuideStub>
implements RouteGuide {
private RouteGuideStub(io.grpc.Channel channel) {
super(channel);
}
private RouteGuideStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected RouteGuideStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new RouteGuideStub(channel, callOptions);
}
@java.lang.Override
public void getFeature(io.grpc.examples.routeguide.Point request,
io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.Feature> responseObserver) {
asyncUnaryCall(
getChannel().newCall(METHOD_GET_FEATURE, getCallOptions()), request, responseObserver);
}
@java.lang.Override
public void listFeatures(io.grpc.examples.routeguide.Rectangle request,
io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.Feature> responseObserver) {
asyncServerStreamingCall(
getChannel().newCall(METHOD_LIST_FEATURES, getCallOptions()), request, responseObserver);
}
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.Point> recordRoute(
io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteSummary> responseObserver) {
return asyncClientStreamingCall(
getChannel().newCall(METHOD_RECORD_ROUTE, getCallOptions()), responseObserver);
}
@java.lang.Override
public io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteNote> routeChat(
io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteNote> responseObserver) {
return asyncBidiStreamingCall(
getChannel().newCall(METHOD_ROUTE_CHAT, getCallOptions()), responseObserver);
}
}
public static class RouteGuideBlockingStub extends io.grpc.stub.AbstractStub<RouteGuideBlockingStub>
implements RouteGuideBlockingClient {
private RouteGuideBlockingStub(io.grpc.Channel channel) {
super(channel);
}
private RouteGuideBlockingStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected RouteGuideBlockingStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new RouteGuideBlockingStub(channel, callOptions);
}
@java.lang.Override
public io.grpc.examples.routeguide.Feature getFeature(io.grpc.examples.routeguide.Point request) {
return blockingUnaryCall(
getChannel(), METHOD_GET_FEATURE, getCallOptions(), request);
}
@java.lang.Override
public java.util.Iterator<io.grpc.examples.routeguide.Feature> listFeatures(
io.grpc.examples.routeguide.Rectangle request) {
return blockingServerStreamingCall(
getChannel(), METHOD_LIST_FEATURES, getCallOptions(), request);
}
}
public static class RouteGuideFutureStub extends io.grpc.stub.AbstractStub<RouteGuideFutureStub>
implements RouteGuideFutureClient {
private RouteGuideFutureStub(io.grpc.Channel channel) {
super(channel);
}
private RouteGuideFutureStub(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
super(channel, callOptions);
}
@java.lang.Override
protected RouteGuideFutureStub build(io.grpc.Channel channel,
io.grpc.CallOptions callOptions) {
return new RouteGuideFutureStub(channel, callOptions);
}
@java.lang.Override
public com.google.common.util.concurrent.ListenableFuture<io.grpc.examples.routeguide.Feature> getFeature(
io.grpc.examples.routeguide.Point request) {
return futureUnaryCall(
getChannel().newCall(METHOD_GET_FEATURE, getCallOptions()), request);
}
}
@java.lang.Deprecated public static abstract class AbstractRouteGuide extends RouteGuideImplBase {}
private static final int METHODID_GET_FEATURE = 0;
private static final int METHODID_LIST_FEATURES = 1;
private static final int METHODID_RECORD_ROUTE = 2;
private static final int METHODID_ROUTE_CHAT = 3;
private static class MethodHandlers<Req, Resp> implements
io.grpc.stub.ServerCalls.UnaryMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ServerStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.ClientStreamingMethod<Req, Resp>,
io.grpc.stub.ServerCalls.BidiStreamingMethod<Req, Resp> {
private final RouteGuide serviceImpl;
private final int methodId;
public MethodHandlers(RouteGuide serviceImpl, int methodId) {
this.serviceImpl = serviceImpl;
this.methodId = methodId;
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public void invoke(Req request, io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
case METHODID_GET_FEATURE:
serviceImpl.getFeature((io.grpc.examples.routeguide.Point) request,
(io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.Feature>) responseObserver);
break;
case METHODID_LIST_FEATURES:
serviceImpl.listFeatures((io.grpc.examples.routeguide.Rectangle) request,
(io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.Feature>) responseObserver);
break;
default:
throw new AssertionError();
}
}
@java.lang.Override
@java.lang.SuppressWarnings("unchecked")
public io.grpc.stub.StreamObserver<Req> invoke(
io.grpc.stub.StreamObserver<Resp> responseObserver) {
switch (methodId) {
case METHODID_RECORD_ROUTE:
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.recordRoute(
(io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteSummary>) responseObserver);
case METHODID_ROUTE_CHAT:
return (io.grpc.stub.StreamObserver<Req>) serviceImpl.routeChat(
(io.grpc.stub.StreamObserver<io.grpc.examples.routeguide.RouteNote>) responseObserver);
default:
throw new AssertionError();
}
}
}
public static io.grpc.ServiceDescriptor getServiceDescriptor() {
return new io.grpc.ServiceDescriptor(SERVICE_NAME,
METHOD_GET_FEATURE,
METHOD_LIST_FEATURES,
METHOD_RECORD_ROUTE,
METHOD_ROUTE_CHAT);
}
@java.lang.Deprecated public static io.grpc.ServerServiceDefinition bindService(
final RouteGuide serviceImpl) {
return io.grpc.ServerServiceDefinition.builder(getServiceDescriptor())
.addMethod(
METHOD_GET_FEATURE,
asyncUnaryCall(
new MethodHandlers<
io.grpc.examples.routeguide.Point,
io.grpc.examples.routeguide.Feature>(
serviceImpl, METHODID_GET_FEATURE)))
.addMethod(
METHOD_LIST_FEATURES,
asyncServerStreamingCall(
new MethodHandlers<
io.grpc.examples.routeguide.Rectangle,
io.grpc.examples.routeguide.Feature>(
serviceImpl, METHODID_LIST_FEATURES)))
.addMethod(
METHOD_RECORD_ROUTE,
asyncClientStreamingCall(
new MethodHandlers<
io.grpc.examples.routeguide.Point,
io.grpc.examples.routeguide.RouteSummary>(
serviceImpl, METHODID_RECORD_ROUTE)))
.addMethod(
METHOD_ROUTE_CHAT,
asyncBidiStreamingCall(
new MethodHandlers<
io.grpc.examples.routeguide.RouteNote,
io.grpc.examples.routeguide.RouteNote>(
serviceImpl, METHODID_ROUTE_CHAT)))
.build();
}
}

View File

@ -1,445 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: helloworld.proto
package io.grpc.examples.helloworld;
/**
* <pre>
* The response message containing the greetings
* </pre>
*
* Protobuf type {@code helloworld.HelloReply}
*/
public final class HelloReply extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:helloworld.HelloReply)
HelloReplyOrBuilder {
// Use HelloReply.newBuilder() to construct.
private HelloReply(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
}
private HelloReply() {
message_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private HelloReply(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
java.lang.String s = input.readStringRequireUtf8();
message_ = s;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloReply_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloReply_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.helloworld.HelloReply.class, io.grpc.examples.helloworld.HelloReply.Builder.class);
}
public static final int MESSAGE_FIELD_NUMBER = 1;
private volatile java.lang.Object message_;
/**
* <code>optional string message = 1;</code>
*/
public java.lang.String getMessage() {
java.lang.Object ref = message_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
message_ = s;
return s;
}
}
/**
* <code>optional string message = 1;</code>
*/
public com.google.protobuf.ByteString
getMessageBytes() {
java.lang.Object ref = message_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getMessageBytes().isEmpty()) {
com.google.protobuf.GeneratedMessage.writeString(output, 1, message_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getMessageBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, message_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
public static io.grpc.examples.helloworld.HelloReply parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.helloworld.HelloReply parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.helloworld.HelloReply parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.helloworld.HelloReply parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.helloworld.HelloReply parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.helloworld.HelloReply parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.helloworld.HelloReply parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.examples.helloworld.HelloReply parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.helloworld.HelloReply parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.helloworld.HelloReply parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.examples.helloworld.HelloReply prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* The response message containing the greetings
* </pre>
*
* Protobuf type {@code helloworld.HelloReply}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:helloworld.HelloReply)
io.grpc.examples.helloworld.HelloReplyOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloReply_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloReply_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.helloworld.HelloReply.class, io.grpc.examples.helloworld.HelloReply.Builder.class);
}
// Construct using io.grpc.examples.helloworld.HelloReply.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
message_ = "";
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloReply_descriptor;
}
public io.grpc.examples.helloworld.HelloReply getDefaultInstanceForType() {
return io.grpc.examples.helloworld.HelloReply.getDefaultInstance();
}
public io.grpc.examples.helloworld.HelloReply build() {
io.grpc.examples.helloworld.HelloReply result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.examples.helloworld.HelloReply buildPartial() {
io.grpc.examples.helloworld.HelloReply result = new io.grpc.examples.helloworld.HelloReply(this);
result.message_ = message_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.examples.helloworld.HelloReply) {
return mergeFrom((io.grpc.examples.helloworld.HelloReply)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.examples.helloworld.HelloReply other) {
if (other == io.grpc.examples.helloworld.HelloReply.getDefaultInstance()) return this;
if (!other.getMessage().isEmpty()) {
message_ = other.message_;
onChanged();
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.examples.helloworld.HelloReply parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.examples.helloworld.HelloReply) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object message_ = "";
/**
* <code>optional string message = 1;</code>
*/
public java.lang.String getMessage() {
java.lang.Object ref = message_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
message_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string message = 1;</code>
*/
public com.google.protobuf.ByteString
getMessageBytes() {
java.lang.Object ref = message_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string message = 1;</code>
*/
public Builder setMessage(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
message_ = value;
onChanged();
return this;
}
/**
* <code>optional string message = 1;</code>
*/
public Builder clearMessage() {
message_ = getDefaultInstance().getMessage();
onChanged();
return this;
}
/**
* <code>optional string message = 1;</code>
*/
public Builder setMessageBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
message_ = value;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:helloworld.HelloReply)
}
// @@protoc_insertion_point(class_scope:helloworld.HelloReply)
private static final io.grpc.examples.helloworld.HelloReply DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.examples.helloworld.HelloReply();
}
public static io.grpc.examples.helloworld.HelloReply getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<HelloReply>
PARSER = new com.google.protobuf.AbstractParser<HelloReply>() {
public HelloReply parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new HelloReply(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<HelloReply> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<HelloReply> getParserForType() {
return PARSER;
}
public io.grpc.examples.helloworld.HelloReply getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -1,19 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: helloworld.proto
package io.grpc.examples.helloworld;
public interface HelloReplyOrBuilder extends
// @@protoc_insertion_point(interface_extends:helloworld.HelloReply)
com.google.protobuf.MessageOrBuilder {
/**
* <code>optional string message = 1;</code>
*/
java.lang.String getMessage();
/**
* <code>optional string message = 1;</code>
*/
com.google.protobuf.ByteString
getMessageBytes();
}

View File

@ -1,445 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: helloworld.proto
package io.grpc.examples.helloworld;
/**
* <pre>
* The request message containing the user's name.
* </pre>
*
* Protobuf type {@code helloworld.HelloRequest}
*/
public final class HelloRequest extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:helloworld.HelloRequest)
HelloRequestOrBuilder {
// Use HelloRequest.newBuilder() to construct.
private HelloRequest(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
}
private HelloRequest() {
name_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private HelloRequest(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.helloworld.HelloRequest.class, io.grpc.examples.helloworld.HelloRequest.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
* <code>optional string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
* <code>optional string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
public static io.grpc.examples.helloworld.HelloRequest parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.helloworld.HelloRequest parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.helloworld.HelloRequest parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.helloworld.HelloRequest parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.helloworld.HelloRequest parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.helloworld.HelloRequest parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.helloworld.HelloRequest parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.examples.helloworld.HelloRequest parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.helloworld.HelloRequest parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.helloworld.HelloRequest parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.examples.helloworld.HelloRequest prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* The request message containing the user's name.
* </pre>
*
* Protobuf type {@code helloworld.HelloRequest}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:helloworld.HelloRequest)
io.grpc.examples.helloworld.HelloRequestOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloRequest_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloRequest_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.helloworld.HelloRequest.class, io.grpc.examples.helloworld.HelloRequest.Builder.class);
}
// Construct using io.grpc.examples.helloworld.HelloRequest.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
name_ = "";
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.examples.helloworld.HelloWorldProto.internal_static_helloworld_HelloRequest_descriptor;
}
public io.grpc.examples.helloworld.HelloRequest getDefaultInstanceForType() {
return io.grpc.examples.helloworld.HelloRequest.getDefaultInstance();
}
public io.grpc.examples.helloworld.HelloRequest build() {
io.grpc.examples.helloworld.HelloRequest result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.examples.helloworld.HelloRequest buildPartial() {
io.grpc.examples.helloworld.HelloRequest result = new io.grpc.examples.helloworld.HelloRequest(this);
result.name_ = name_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.examples.helloworld.HelloRequest) {
return mergeFrom((io.grpc.examples.helloworld.HelloRequest)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.examples.helloworld.HelloRequest other) {
if (other == io.grpc.examples.helloworld.HelloRequest.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.examples.helloworld.HelloRequest parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.examples.helloworld.HelloRequest) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object name_ = "";
/**
* <code>optional string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <code>optional string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <code>optional string name = 1;</code>
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
* <code>optional string name = 1;</code>
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <code>optional string name = 1;</code>
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:helloworld.HelloRequest)
}
// @@protoc_insertion_point(class_scope:helloworld.HelloRequest)
private static final io.grpc.examples.helloworld.HelloRequest DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.examples.helloworld.HelloRequest();
}
public static io.grpc.examples.helloworld.HelloRequest getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<HelloRequest>
PARSER = new com.google.protobuf.AbstractParser<HelloRequest>() {
public HelloRequest parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new HelloRequest(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<HelloRequest> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<HelloRequest> getParserForType() {
return PARSER;
}
public io.grpc.examples.helloworld.HelloRequest getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -1,19 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: helloworld.proto
package io.grpc.examples.helloworld;
public interface HelloRequestOrBuilder extends
// @@protoc_insertion_point(interface_extends:helloworld.HelloRequest)
com.google.protobuf.MessageOrBuilder {
/**
* <code>optional string name = 1;</code>
*/
java.lang.String getName();
/**
* <code>optional string name = 1;</code>
*/
com.google.protobuf.ByteString
getNameBytes();
}

View File

@ -1,64 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: helloworld.proto
package io.grpc.examples.helloworld;
public final class HelloWorldProto {
private HelloWorldProto() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_helloworld_HelloRequest_descriptor;
static final
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_helloworld_HelloRequest_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_helloworld_HelloReply_descriptor;
static final
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_helloworld_HelloReply_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\020helloworld.proto\022\nhelloworld\"\034\n\014HelloR" +
"equest\022\014\n\004name\030\001 \001(\t\"\035\n\nHelloReply\022\017\n\007me" +
"ssage\030\001 \001(\t2I\n\007Greeter\022>\n\010SayHello\022\030.hel" +
"loworld.HelloRequest\032\026.helloworld.HelloR" +
"eply\"\000B6\n\033io.grpc.examples.helloworldB\017H" +
"elloWorldProtoP\001\242\002\003HLWb\006proto3"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
internal_static_helloworld_HelloRequest_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_helloworld_HelloRequest_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_helloworld_HelloRequest_descriptor,
new java.lang.String[] { "Name", });
internal_static_helloworld_HelloReply_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_helloworld_HelloReply_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_helloworld_HelloReply_descriptor,
new java.lang.String[] { "Message", });
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@ -1,695 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
/**
* <pre>
* A feature names something at a given point.
* If a feature could not be named, the name is empty.
* </pre>
*
* Protobuf type {@code routeguide.Feature}
*/
public final class Feature extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:routeguide.Feature)
FeatureOrBuilder {
// Use Feature.newBuilder() to construct.
private Feature(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
}
private Feature() {
name_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private Feature(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
java.lang.String s = input.readStringRequireUtf8();
name_ = s;
break;
}
case 18: {
io.grpc.examples.routeguide.Point.Builder subBuilder = null;
if (location_ != null) {
subBuilder = location_.toBuilder();
}
location_ = input.readMessage(io.grpc.examples.routeguide.Point.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(location_);
location_ = subBuilder.buildPartial();
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Feature_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Feature_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.routeguide.Feature.class, io.grpc.examples.routeguide.Feature.Builder.class);
}
public static final int NAME_FIELD_NUMBER = 1;
private volatile java.lang.Object name_;
/**
* <pre>
* The name of the feature.
* </pre>
*
* <code>optional string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
}
}
/**
* <pre>
* The name of the feature.
* </pre>
*
* <code>optional string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
public static final int LOCATION_FIELD_NUMBER = 2;
private io.grpc.examples.routeguide.Point location_;
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
public boolean hasLocation() {
return location_ != null;
}
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
public io.grpc.examples.routeguide.Point getLocation() {
return location_ == null ? io.grpc.examples.routeguide.Point.getDefaultInstance() : location_;
}
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
public io.grpc.examples.routeguide.PointOrBuilder getLocationOrBuilder() {
return getLocation();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (!getNameBytes().isEmpty()) {
com.google.protobuf.GeneratedMessage.writeString(output, 1, name_);
}
if (location_ != null) {
output.writeMessage(2, getLocation());
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (!getNameBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(1, name_);
}
if (location_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getLocation());
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
public static io.grpc.examples.routeguide.Feature parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.routeguide.Feature parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.routeguide.Feature parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.routeguide.Feature parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.routeguide.Feature parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.Feature parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.routeguide.Feature parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.Feature parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.routeguide.Feature parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.Feature parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.examples.routeguide.Feature prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* A feature names something at a given point.
* If a feature could not be named, the name is empty.
* </pre>
*
* Protobuf type {@code routeguide.Feature}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:routeguide.Feature)
io.grpc.examples.routeguide.FeatureOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Feature_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Feature_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.routeguide.Feature.class, io.grpc.examples.routeguide.Feature.Builder.class);
}
// Construct using io.grpc.examples.routeguide.Feature.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
name_ = "";
if (locationBuilder_ == null) {
location_ = null;
} else {
location_ = null;
locationBuilder_ = null;
}
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Feature_descriptor;
}
public io.grpc.examples.routeguide.Feature getDefaultInstanceForType() {
return io.grpc.examples.routeguide.Feature.getDefaultInstance();
}
public io.grpc.examples.routeguide.Feature build() {
io.grpc.examples.routeguide.Feature result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.examples.routeguide.Feature buildPartial() {
io.grpc.examples.routeguide.Feature result = new io.grpc.examples.routeguide.Feature(this);
result.name_ = name_;
if (locationBuilder_ == null) {
result.location_ = location_;
} else {
result.location_ = locationBuilder_.build();
}
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.examples.routeguide.Feature) {
return mergeFrom((io.grpc.examples.routeguide.Feature)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.examples.routeguide.Feature other) {
if (other == io.grpc.examples.routeguide.Feature.getDefaultInstance()) return this;
if (!other.getName().isEmpty()) {
name_ = other.name_;
onChanged();
}
if (other.hasLocation()) {
mergeLocation(other.getLocation());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.examples.routeguide.Feature parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.examples.routeguide.Feature) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private java.lang.Object name_ = "";
/**
* <pre>
* The name of the feature.
* </pre>
*
* <code>optional string name = 1;</code>
*/
public java.lang.String getName() {
java.lang.Object ref = name_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
name_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
* The name of the feature.
* </pre>
*
* <code>optional string name = 1;</code>
*/
public com.google.protobuf.ByteString
getNameBytes() {
java.lang.Object ref = name_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
name_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
* The name of the feature.
* </pre>
*
* <code>optional string name = 1;</code>
*/
public Builder setName(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
name_ = value;
onChanged();
return this;
}
/**
* <pre>
* The name of the feature.
* </pre>
*
* <code>optional string name = 1;</code>
*/
public Builder clearName() {
name_ = getDefaultInstance().getName();
onChanged();
return this;
}
/**
* <pre>
* The name of the feature.
* </pre>
*
* <code>optional string name = 1;</code>
*/
public Builder setNameBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
name_ = value;
onChanged();
return this;
}
private io.grpc.examples.routeguide.Point location_ = null;
private com.google.protobuf.SingleFieldBuilder<
io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.Point.Builder, io.grpc.examples.routeguide.PointOrBuilder> locationBuilder_;
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
public boolean hasLocation() {
return locationBuilder_ != null || location_ != null;
}
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
public io.grpc.examples.routeguide.Point getLocation() {
if (locationBuilder_ == null) {
return location_ == null ? io.grpc.examples.routeguide.Point.getDefaultInstance() : location_;
} else {
return locationBuilder_.getMessage();
}
}
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
public Builder setLocation(io.grpc.examples.routeguide.Point value) {
if (locationBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
location_ = value;
onChanged();
} else {
locationBuilder_.setMessage(value);
}
return this;
}
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
public Builder setLocation(
io.grpc.examples.routeguide.Point.Builder builderForValue) {
if (locationBuilder_ == null) {
location_ = builderForValue.build();
onChanged();
} else {
locationBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
public Builder mergeLocation(io.grpc.examples.routeguide.Point value) {
if (locationBuilder_ == null) {
if (location_ != null) {
location_ =
io.grpc.examples.routeguide.Point.newBuilder(location_).mergeFrom(value).buildPartial();
} else {
location_ = value;
}
onChanged();
} else {
locationBuilder_.mergeFrom(value);
}
return this;
}
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
public Builder clearLocation() {
if (locationBuilder_ == null) {
location_ = null;
onChanged();
} else {
location_ = null;
locationBuilder_ = null;
}
return this;
}
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
public io.grpc.examples.routeguide.Point.Builder getLocationBuilder() {
onChanged();
return getLocationFieldBuilder().getBuilder();
}
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
public io.grpc.examples.routeguide.PointOrBuilder getLocationOrBuilder() {
if (locationBuilder_ != null) {
return locationBuilder_.getMessageOrBuilder();
} else {
return location_ == null ?
io.grpc.examples.routeguide.Point.getDefaultInstance() : location_;
}
}
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.Point.Builder, io.grpc.examples.routeguide.PointOrBuilder>
getLocationFieldBuilder() {
if (locationBuilder_ == null) {
locationBuilder_ = new com.google.protobuf.SingleFieldBuilder<
io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.Point.Builder, io.grpc.examples.routeguide.PointOrBuilder>(
getLocation(),
getParentForChildren(),
isClean());
location_ = null;
}
return locationBuilder_;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:routeguide.Feature)
}
// @@protoc_insertion_point(class_scope:routeguide.Feature)
private static final io.grpc.examples.routeguide.Feature DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.examples.routeguide.Feature();
}
public static io.grpc.examples.routeguide.Feature getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<Feature>
PARSER = new com.google.protobuf.AbstractParser<Feature>() {
public Feature parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Feature(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<Feature> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<Feature> getParserForType() {
return PARSER;
}
public io.grpc.examples.routeguide.Feature getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -1,660 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
/**
* <pre>
* Not used in the RPC. Instead, this is here for the form serialized to disk.
* </pre>
*
* Protobuf type {@code routeguide.FeatureDatabase}
*/
public final class FeatureDatabase extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:routeguide.FeatureDatabase)
FeatureDatabaseOrBuilder {
// Use FeatureDatabase.newBuilder() to construct.
private FeatureDatabase(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
}
private FeatureDatabase() {
feature_ = java.util.Collections.emptyList();
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private FeatureDatabase(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
if (!((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
feature_ = new java.util.ArrayList<io.grpc.examples.routeguide.Feature>();
mutable_bitField0_ |= 0x00000001;
}
feature_.add(input.readMessage(io.grpc.examples.routeguide.Feature.parser(), extensionRegistry));
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
if (((mutable_bitField0_ & 0x00000001) == 0x00000001)) {
feature_ = java.util.Collections.unmodifiableList(feature_);
}
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_FeatureDatabase_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_FeatureDatabase_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.routeguide.FeatureDatabase.class, io.grpc.examples.routeguide.FeatureDatabase.Builder.class);
}
public static final int FEATURE_FIELD_NUMBER = 1;
private java.util.List<io.grpc.examples.routeguide.Feature> feature_;
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public java.util.List<io.grpc.examples.routeguide.Feature> getFeatureList() {
return feature_;
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public java.util.List<? extends io.grpc.examples.routeguide.FeatureOrBuilder>
getFeatureOrBuilderList() {
return feature_;
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public int getFeatureCount() {
return feature_.size();
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public io.grpc.examples.routeguide.Feature getFeature(int index) {
return feature_.get(index);
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public io.grpc.examples.routeguide.FeatureOrBuilder getFeatureOrBuilder(
int index) {
return feature_.get(index);
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
for (int i = 0; i < feature_.size(); i++) {
output.writeMessage(1, feature_.get(i));
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
for (int i = 0; i < feature_.size(); i++) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, feature_.get(i));
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
public static io.grpc.examples.routeguide.FeatureDatabase parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.routeguide.FeatureDatabase parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.routeguide.FeatureDatabase parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.routeguide.FeatureDatabase parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.routeguide.FeatureDatabase parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.FeatureDatabase parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.routeguide.FeatureDatabase parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.FeatureDatabase parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.routeguide.FeatureDatabase parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.FeatureDatabase parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.examples.routeguide.FeatureDatabase prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* Not used in the RPC. Instead, this is here for the form serialized to disk.
* </pre>
*
* Protobuf type {@code routeguide.FeatureDatabase}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:routeguide.FeatureDatabase)
io.grpc.examples.routeguide.FeatureDatabaseOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_FeatureDatabase_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_FeatureDatabase_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.routeguide.FeatureDatabase.class, io.grpc.examples.routeguide.FeatureDatabase.Builder.class);
}
// Construct using io.grpc.examples.routeguide.FeatureDatabase.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
getFeatureFieldBuilder();
}
}
public Builder clear() {
super.clear();
if (featureBuilder_ == null) {
feature_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
} else {
featureBuilder_.clear();
}
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_FeatureDatabase_descriptor;
}
public io.grpc.examples.routeguide.FeatureDatabase getDefaultInstanceForType() {
return io.grpc.examples.routeguide.FeatureDatabase.getDefaultInstance();
}
public io.grpc.examples.routeguide.FeatureDatabase build() {
io.grpc.examples.routeguide.FeatureDatabase result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.examples.routeguide.FeatureDatabase buildPartial() {
io.grpc.examples.routeguide.FeatureDatabase result = new io.grpc.examples.routeguide.FeatureDatabase(this);
int from_bitField0_ = bitField0_;
if (featureBuilder_ == null) {
if (((bitField0_ & 0x00000001) == 0x00000001)) {
feature_ = java.util.Collections.unmodifiableList(feature_);
bitField0_ = (bitField0_ & ~0x00000001);
}
result.feature_ = feature_;
} else {
result.feature_ = featureBuilder_.build();
}
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.examples.routeguide.FeatureDatabase) {
return mergeFrom((io.grpc.examples.routeguide.FeatureDatabase)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.examples.routeguide.FeatureDatabase other) {
if (other == io.grpc.examples.routeguide.FeatureDatabase.getDefaultInstance()) return this;
if (featureBuilder_ == null) {
if (!other.feature_.isEmpty()) {
if (feature_.isEmpty()) {
feature_ = other.feature_;
bitField0_ = (bitField0_ & ~0x00000001);
} else {
ensureFeatureIsMutable();
feature_.addAll(other.feature_);
}
onChanged();
}
} else {
if (!other.feature_.isEmpty()) {
if (featureBuilder_.isEmpty()) {
featureBuilder_.dispose();
featureBuilder_ = null;
feature_ = other.feature_;
bitField0_ = (bitField0_ & ~0x00000001);
featureBuilder_ =
com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders ?
getFeatureFieldBuilder() : null;
} else {
featureBuilder_.addAllMessages(other.feature_);
}
}
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.examples.routeguide.FeatureDatabase parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.examples.routeguide.FeatureDatabase) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int bitField0_;
private java.util.List<io.grpc.examples.routeguide.Feature> feature_ =
java.util.Collections.emptyList();
private void ensureFeatureIsMutable() {
if (!((bitField0_ & 0x00000001) == 0x00000001)) {
feature_ = new java.util.ArrayList<io.grpc.examples.routeguide.Feature>(feature_);
bitField0_ |= 0x00000001;
}
}
private com.google.protobuf.RepeatedFieldBuilder<
io.grpc.examples.routeguide.Feature, io.grpc.examples.routeguide.Feature.Builder, io.grpc.examples.routeguide.FeatureOrBuilder> featureBuilder_;
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public java.util.List<io.grpc.examples.routeguide.Feature> getFeatureList() {
if (featureBuilder_ == null) {
return java.util.Collections.unmodifiableList(feature_);
} else {
return featureBuilder_.getMessageList();
}
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public int getFeatureCount() {
if (featureBuilder_ == null) {
return feature_.size();
} else {
return featureBuilder_.getCount();
}
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public io.grpc.examples.routeguide.Feature getFeature(int index) {
if (featureBuilder_ == null) {
return feature_.get(index);
} else {
return featureBuilder_.getMessage(index);
}
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public Builder setFeature(
int index, io.grpc.examples.routeguide.Feature value) {
if (featureBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureFeatureIsMutable();
feature_.set(index, value);
onChanged();
} else {
featureBuilder_.setMessage(index, value);
}
return this;
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public Builder setFeature(
int index, io.grpc.examples.routeguide.Feature.Builder builderForValue) {
if (featureBuilder_ == null) {
ensureFeatureIsMutable();
feature_.set(index, builderForValue.build());
onChanged();
} else {
featureBuilder_.setMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public Builder addFeature(io.grpc.examples.routeguide.Feature value) {
if (featureBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureFeatureIsMutable();
feature_.add(value);
onChanged();
} else {
featureBuilder_.addMessage(value);
}
return this;
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public Builder addFeature(
int index, io.grpc.examples.routeguide.Feature value) {
if (featureBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
ensureFeatureIsMutable();
feature_.add(index, value);
onChanged();
} else {
featureBuilder_.addMessage(index, value);
}
return this;
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public Builder addFeature(
io.grpc.examples.routeguide.Feature.Builder builderForValue) {
if (featureBuilder_ == null) {
ensureFeatureIsMutable();
feature_.add(builderForValue.build());
onChanged();
} else {
featureBuilder_.addMessage(builderForValue.build());
}
return this;
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public Builder addFeature(
int index, io.grpc.examples.routeguide.Feature.Builder builderForValue) {
if (featureBuilder_ == null) {
ensureFeatureIsMutable();
feature_.add(index, builderForValue.build());
onChanged();
} else {
featureBuilder_.addMessage(index, builderForValue.build());
}
return this;
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public Builder addAllFeature(
java.lang.Iterable<? extends io.grpc.examples.routeguide.Feature> values) {
if (featureBuilder_ == null) {
ensureFeatureIsMutable();
com.google.protobuf.AbstractMessageLite.Builder.addAll(
values, feature_);
onChanged();
} else {
featureBuilder_.addAllMessages(values);
}
return this;
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public Builder clearFeature() {
if (featureBuilder_ == null) {
feature_ = java.util.Collections.emptyList();
bitField0_ = (bitField0_ & ~0x00000001);
onChanged();
} else {
featureBuilder_.clear();
}
return this;
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public Builder removeFeature(int index) {
if (featureBuilder_ == null) {
ensureFeatureIsMutable();
feature_.remove(index);
onChanged();
} else {
featureBuilder_.remove(index);
}
return this;
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public io.grpc.examples.routeguide.Feature.Builder getFeatureBuilder(
int index) {
return getFeatureFieldBuilder().getBuilder(index);
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public io.grpc.examples.routeguide.FeatureOrBuilder getFeatureOrBuilder(
int index) {
if (featureBuilder_ == null) {
return feature_.get(index); } else {
return featureBuilder_.getMessageOrBuilder(index);
}
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public java.util.List<? extends io.grpc.examples.routeguide.FeatureOrBuilder>
getFeatureOrBuilderList() {
if (featureBuilder_ != null) {
return featureBuilder_.getMessageOrBuilderList();
} else {
return java.util.Collections.unmodifiableList(feature_);
}
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public io.grpc.examples.routeguide.Feature.Builder addFeatureBuilder() {
return getFeatureFieldBuilder().addBuilder(
io.grpc.examples.routeguide.Feature.getDefaultInstance());
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public io.grpc.examples.routeguide.Feature.Builder addFeatureBuilder(
int index) {
return getFeatureFieldBuilder().addBuilder(
index, io.grpc.examples.routeguide.Feature.getDefaultInstance());
}
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
public java.util.List<io.grpc.examples.routeguide.Feature.Builder>
getFeatureBuilderList() {
return getFeatureFieldBuilder().getBuilderList();
}
private com.google.protobuf.RepeatedFieldBuilder<
io.grpc.examples.routeguide.Feature, io.grpc.examples.routeguide.Feature.Builder, io.grpc.examples.routeguide.FeatureOrBuilder>
getFeatureFieldBuilder() {
if (featureBuilder_ == null) {
featureBuilder_ = new com.google.protobuf.RepeatedFieldBuilder<
io.grpc.examples.routeguide.Feature, io.grpc.examples.routeguide.Feature.Builder, io.grpc.examples.routeguide.FeatureOrBuilder>(
feature_,
((bitField0_ & 0x00000001) == 0x00000001),
getParentForChildren(),
isClean());
feature_ = null;
}
return featureBuilder_;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:routeguide.FeatureDatabase)
}
// @@protoc_insertion_point(class_scope:routeguide.FeatureDatabase)
private static final io.grpc.examples.routeguide.FeatureDatabase DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.examples.routeguide.FeatureDatabase();
}
public static io.grpc.examples.routeguide.FeatureDatabase getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<FeatureDatabase>
PARSER = new com.google.protobuf.AbstractParser<FeatureDatabase>() {
public FeatureDatabase parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new FeatureDatabase(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<FeatureDatabase> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<FeatureDatabase> getParserForType() {
return PARSER;
}
public io.grpc.examples.routeguide.FeatureDatabase getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -1,33 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
public interface FeatureDatabaseOrBuilder extends
// @@protoc_insertion_point(interface_extends:routeguide.FeatureDatabase)
com.google.protobuf.MessageOrBuilder {
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
java.util.List<io.grpc.examples.routeguide.Feature>
getFeatureList();
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
io.grpc.examples.routeguide.Feature getFeature(int index);
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
int getFeatureCount();
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
java.util.List<? extends io.grpc.examples.routeguide.FeatureOrBuilder>
getFeatureOrBuilderList();
/**
* <code>repeated .routeguide.Feature feature = 1;</code>
*/
io.grpc.examples.routeguide.FeatureOrBuilder getFeatureOrBuilder(
int index);
}

View File

@ -1,52 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
public interface FeatureOrBuilder extends
// @@protoc_insertion_point(interface_extends:routeguide.Feature)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* The name of the feature.
* </pre>
*
* <code>optional string name = 1;</code>
*/
java.lang.String getName();
/**
* <pre>
* The name of the feature.
* </pre>
*
* <code>optional string name = 1;</code>
*/
com.google.protobuf.ByteString
getNameBytes();
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
boolean hasLocation();
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
io.grpc.examples.routeguide.Point getLocation();
/**
* <pre>
* The point where the feature is detected.
* </pre>
*
* <code>optional .routeguide.Point location = 2;</code>
*/
io.grpc.examples.routeguide.PointOrBuilder getLocationOrBuilder();
}

View File

@ -1,436 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
/**
* <pre>
* Points are represented as latitude-longitude pairs in the E7 representation
* (degrees multiplied by 10**7 and rounded to the nearest integer).
* Latitudes should be in the range +/- 90 degrees and longitude should be in
* the range +/- 180 degrees (inclusive).
* </pre>
*
* Protobuf type {@code routeguide.Point}
*/
public final class Point extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:routeguide.Point)
PointOrBuilder {
// Use Point.newBuilder() to construct.
private Point(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
}
private Point() {
latitude_ = 0;
longitude_ = 0;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private Point(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 8: {
latitude_ = input.readInt32();
break;
}
case 16: {
longitude_ = input.readInt32();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Point_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Point_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.routeguide.Point.class, io.grpc.examples.routeguide.Point.Builder.class);
}
public static final int LATITUDE_FIELD_NUMBER = 1;
private int latitude_;
/**
* <code>optional int32 latitude = 1;</code>
*/
public int getLatitude() {
return latitude_;
}
public static final int LONGITUDE_FIELD_NUMBER = 2;
private int longitude_;
/**
* <code>optional int32 longitude = 2;</code>
*/
public int getLongitude() {
return longitude_;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (latitude_ != 0) {
output.writeInt32(1, latitude_);
}
if (longitude_ != 0) {
output.writeInt32(2, longitude_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (latitude_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, latitude_);
}
if (longitude_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, longitude_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
public static io.grpc.examples.routeguide.Point parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.routeguide.Point parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.routeguide.Point parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.routeguide.Point parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.routeguide.Point parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.Point parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.routeguide.Point parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.Point parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.routeguide.Point parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.Point parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.examples.routeguide.Point prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* Points are represented as latitude-longitude pairs in the E7 representation
* (degrees multiplied by 10**7 and rounded to the nearest integer).
* Latitudes should be in the range +/- 90 degrees and longitude should be in
* the range +/- 180 degrees (inclusive).
* </pre>
*
* Protobuf type {@code routeguide.Point}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:routeguide.Point)
io.grpc.examples.routeguide.PointOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Point_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Point_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.routeguide.Point.class, io.grpc.examples.routeguide.Point.Builder.class);
}
// Construct using io.grpc.examples.routeguide.Point.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
latitude_ = 0;
longitude_ = 0;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Point_descriptor;
}
public io.grpc.examples.routeguide.Point getDefaultInstanceForType() {
return io.grpc.examples.routeguide.Point.getDefaultInstance();
}
public io.grpc.examples.routeguide.Point build() {
io.grpc.examples.routeguide.Point result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.examples.routeguide.Point buildPartial() {
io.grpc.examples.routeguide.Point result = new io.grpc.examples.routeguide.Point(this);
result.latitude_ = latitude_;
result.longitude_ = longitude_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.examples.routeguide.Point) {
return mergeFrom((io.grpc.examples.routeguide.Point)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.examples.routeguide.Point other) {
if (other == io.grpc.examples.routeguide.Point.getDefaultInstance()) return this;
if (other.getLatitude() != 0) {
setLatitude(other.getLatitude());
}
if (other.getLongitude() != 0) {
setLongitude(other.getLongitude());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.examples.routeguide.Point parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.examples.routeguide.Point) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int latitude_ ;
/**
* <code>optional int32 latitude = 1;</code>
*/
public int getLatitude() {
return latitude_;
}
/**
* <code>optional int32 latitude = 1;</code>
*/
public Builder setLatitude(int value) {
latitude_ = value;
onChanged();
return this;
}
/**
* <code>optional int32 latitude = 1;</code>
*/
public Builder clearLatitude() {
latitude_ = 0;
onChanged();
return this;
}
private int longitude_ ;
/**
* <code>optional int32 longitude = 2;</code>
*/
public int getLongitude() {
return longitude_;
}
/**
* <code>optional int32 longitude = 2;</code>
*/
public Builder setLongitude(int value) {
longitude_ = value;
onChanged();
return this;
}
/**
* <code>optional int32 longitude = 2;</code>
*/
public Builder clearLongitude() {
longitude_ = 0;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:routeguide.Point)
}
// @@protoc_insertion_point(class_scope:routeguide.Point)
private static final io.grpc.examples.routeguide.Point DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.examples.routeguide.Point();
}
public static io.grpc.examples.routeguide.Point getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<Point>
PARSER = new com.google.protobuf.AbstractParser<Point>() {
public Point parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Point(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<Point> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<Point> getParserForType() {
return PARSER;
}
public io.grpc.examples.routeguide.Point getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -1,19 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
public interface PointOrBuilder extends
// @@protoc_insertion_point(interface_extends:routeguide.Point)
com.google.protobuf.MessageOrBuilder {
/**
* <code>optional int32 latitude = 1;</code>
*/
int getLatitude();
/**
* <code>optional int32 longitude = 2;</code>
*/
int getLongitude();
}

View File

@ -1,764 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
/**
* <pre>
* A latitude-longitude rectangle, represented as two diagonally opposite
* points "lo" and "hi".
* </pre>
*
* Protobuf type {@code routeguide.Rectangle}
*/
public final class Rectangle extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:routeguide.Rectangle)
RectangleOrBuilder {
// Use Rectangle.newBuilder() to construct.
private Rectangle(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
}
private Rectangle() {
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private Rectangle(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
io.grpc.examples.routeguide.Point.Builder subBuilder = null;
if (lo_ != null) {
subBuilder = lo_.toBuilder();
}
lo_ = input.readMessage(io.grpc.examples.routeguide.Point.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(lo_);
lo_ = subBuilder.buildPartial();
}
break;
}
case 18: {
io.grpc.examples.routeguide.Point.Builder subBuilder = null;
if (hi_ != null) {
subBuilder = hi_.toBuilder();
}
hi_ = input.readMessage(io.grpc.examples.routeguide.Point.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(hi_);
hi_ = subBuilder.buildPartial();
}
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Rectangle_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Rectangle_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.routeguide.Rectangle.class, io.grpc.examples.routeguide.Rectangle.Builder.class);
}
public static final int LO_FIELD_NUMBER = 1;
private io.grpc.examples.routeguide.Point lo_;
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
public boolean hasLo() {
return lo_ != null;
}
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
public io.grpc.examples.routeguide.Point getLo() {
return lo_ == null ? io.grpc.examples.routeguide.Point.getDefaultInstance() : lo_;
}
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
public io.grpc.examples.routeguide.PointOrBuilder getLoOrBuilder() {
return getLo();
}
public static final int HI_FIELD_NUMBER = 2;
private io.grpc.examples.routeguide.Point hi_;
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
public boolean hasHi() {
return hi_ != null;
}
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
public io.grpc.examples.routeguide.Point getHi() {
return hi_ == null ? io.grpc.examples.routeguide.Point.getDefaultInstance() : hi_;
}
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
public io.grpc.examples.routeguide.PointOrBuilder getHiOrBuilder() {
return getHi();
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (lo_ != null) {
output.writeMessage(1, getLo());
}
if (hi_ != null) {
output.writeMessage(2, getHi());
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (lo_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getLo());
}
if (hi_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(2, getHi());
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
public static io.grpc.examples.routeguide.Rectangle parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.routeguide.Rectangle parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.routeguide.Rectangle parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.routeguide.Rectangle parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.routeguide.Rectangle parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.Rectangle parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.routeguide.Rectangle parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.Rectangle parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.routeguide.Rectangle parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.Rectangle parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.examples.routeguide.Rectangle prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* A latitude-longitude rectangle, represented as two diagonally opposite
* points "lo" and "hi".
* </pre>
*
* Protobuf type {@code routeguide.Rectangle}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:routeguide.Rectangle)
io.grpc.examples.routeguide.RectangleOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Rectangle_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Rectangle_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.routeguide.Rectangle.class, io.grpc.examples.routeguide.Rectangle.Builder.class);
}
// Construct using io.grpc.examples.routeguide.Rectangle.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
if (loBuilder_ == null) {
lo_ = null;
} else {
lo_ = null;
loBuilder_ = null;
}
if (hiBuilder_ == null) {
hi_ = null;
} else {
hi_ = null;
hiBuilder_ = null;
}
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_Rectangle_descriptor;
}
public io.grpc.examples.routeguide.Rectangle getDefaultInstanceForType() {
return io.grpc.examples.routeguide.Rectangle.getDefaultInstance();
}
public io.grpc.examples.routeguide.Rectangle build() {
io.grpc.examples.routeguide.Rectangle result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.examples.routeguide.Rectangle buildPartial() {
io.grpc.examples.routeguide.Rectangle result = new io.grpc.examples.routeguide.Rectangle(this);
if (loBuilder_ == null) {
result.lo_ = lo_;
} else {
result.lo_ = loBuilder_.build();
}
if (hiBuilder_ == null) {
result.hi_ = hi_;
} else {
result.hi_ = hiBuilder_.build();
}
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.examples.routeguide.Rectangle) {
return mergeFrom((io.grpc.examples.routeguide.Rectangle)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.examples.routeguide.Rectangle other) {
if (other == io.grpc.examples.routeguide.Rectangle.getDefaultInstance()) return this;
if (other.hasLo()) {
mergeLo(other.getLo());
}
if (other.hasHi()) {
mergeHi(other.getHi());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.examples.routeguide.Rectangle parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.examples.routeguide.Rectangle) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private io.grpc.examples.routeguide.Point lo_ = null;
private com.google.protobuf.SingleFieldBuilder<
io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.Point.Builder, io.grpc.examples.routeguide.PointOrBuilder> loBuilder_;
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
public boolean hasLo() {
return loBuilder_ != null || lo_ != null;
}
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
public io.grpc.examples.routeguide.Point getLo() {
if (loBuilder_ == null) {
return lo_ == null ? io.grpc.examples.routeguide.Point.getDefaultInstance() : lo_;
} else {
return loBuilder_.getMessage();
}
}
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
public Builder setLo(io.grpc.examples.routeguide.Point value) {
if (loBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
lo_ = value;
onChanged();
} else {
loBuilder_.setMessage(value);
}
return this;
}
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
public Builder setLo(
io.grpc.examples.routeguide.Point.Builder builderForValue) {
if (loBuilder_ == null) {
lo_ = builderForValue.build();
onChanged();
} else {
loBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
public Builder mergeLo(io.grpc.examples.routeguide.Point value) {
if (loBuilder_ == null) {
if (lo_ != null) {
lo_ =
io.grpc.examples.routeguide.Point.newBuilder(lo_).mergeFrom(value).buildPartial();
} else {
lo_ = value;
}
onChanged();
} else {
loBuilder_.mergeFrom(value);
}
return this;
}
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
public Builder clearLo() {
if (loBuilder_ == null) {
lo_ = null;
onChanged();
} else {
lo_ = null;
loBuilder_ = null;
}
return this;
}
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
public io.grpc.examples.routeguide.Point.Builder getLoBuilder() {
onChanged();
return getLoFieldBuilder().getBuilder();
}
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
public io.grpc.examples.routeguide.PointOrBuilder getLoOrBuilder() {
if (loBuilder_ != null) {
return loBuilder_.getMessageOrBuilder();
} else {
return lo_ == null ?
io.grpc.examples.routeguide.Point.getDefaultInstance() : lo_;
}
}
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.Point.Builder, io.grpc.examples.routeguide.PointOrBuilder>
getLoFieldBuilder() {
if (loBuilder_ == null) {
loBuilder_ = new com.google.protobuf.SingleFieldBuilder<
io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.Point.Builder, io.grpc.examples.routeguide.PointOrBuilder>(
getLo(),
getParentForChildren(),
isClean());
lo_ = null;
}
return loBuilder_;
}
private io.grpc.examples.routeguide.Point hi_ = null;
private com.google.protobuf.SingleFieldBuilder<
io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.Point.Builder, io.grpc.examples.routeguide.PointOrBuilder> hiBuilder_;
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
public boolean hasHi() {
return hiBuilder_ != null || hi_ != null;
}
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
public io.grpc.examples.routeguide.Point getHi() {
if (hiBuilder_ == null) {
return hi_ == null ? io.grpc.examples.routeguide.Point.getDefaultInstance() : hi_;
} else {
return hiBuilder_.getMessage();
}
}
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
public Builder setHi(io.grpc.examples.routeguide.Point value) {
if (hiBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
hi_ = value;
onChanged();
} else {
hiBuilder_.setMessage(value);
}
return this;
}
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
public Builder setHi(
io.grpc.examples.routeguide.Point.Builder builderForValue) {
if (hiBuilder_ == null) {
hi_ = builderForValue.build();
onChanged();
} else {
hiBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
public Builder mergeHi(io.grpc.examples.routeguide.Point value) {
if (hiBuilder_ == null) {
if (hi_ != null) {
hi_ =
io.grpc.examples.routeguide.Point.newBuilder(hi_).mergeFrom(value).buildPartial();
} else {
hi_ = value;
}
onChanged();
} else {
hiBuilder_.mergeFrom(value);
}
return this;
}
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
public Builder clearHi() {
if (hiBuilder_ == null) {
hi_ = null;
onChanged();
} else {
hi_ = null;
hiBuilder_ = null;
}
return this;
}
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
public io.grpc.examples.routeguide.Point.Builder getHiBuilder() {
onChanged();
return getHiFieldBuilder().getBuilder();
}
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
public io.grpc.examples.routeguide.PointOrBuilder getHiOrBuilder() {
if (hiBuilder_ != null) {
return hiBuilder_.getMessageOrBuilder();
} else {
return hi_ == null ?
io.grpc.examples.routeguide.Point.getDefaultInstance() : hi_;
}
}
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.Point.Builder, io.grpc.examples.routeguide.PointOrBuilder>
getHiFieldBuilder() {
if (hiBuilder_ == null) {
hiBuilder_ = new com.google.protobuf.SingleFieldBuilder<
io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.Point.Builder, io.grpc.examples.routeguide.PointOrBuilder>(
getHi(),
getParentForChildren(),
isClean());
hi_ = null;
}
return hiBuilder_;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:routeguide.Rectangle)
}
// @@protoc_insertion_point(class_scope:routeguide.Rectangle)
private static final io.grpc.examples.routeguide.Rectangle DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.examples.routeguide.Rectangle();
}
public static io.grpc.examples.routeguide.Rectangle getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<Rectangle>
PARSER = new com.google.protobuf.AbstractParser<Rectangle>() {
public Rectangle parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new Rectangle(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<Rectangle> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<Rectangle> getParserForType() {
return PARSER;
}
public io.grpc.examples.routeguide.Rectangle getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -1,59 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
public interface RectangleOrBuilder extends
// @@protoc_insertion_point(interface_extends:routeguide.Rectangle)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
boolean hasLo();
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
io.grpc.examples.routeguide.Point getLo();
/**
* <pre>
* One corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point lo = 1;</code>
*/
io.grpc.examples.routeguide.PointOrBuilder getLoOrBuilder();
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
boolean hasHi();
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
io.grpc.examples.routeguide.Point getHi();
/**
* <pre>
* The other corner of the rectangle.
* </pre>
*
* <code>optional .routeguide.Point hi = 2;</code>
*/
io.grpc.examples.routeguide.PointOrBuilder getHiOrBuilder();
}

View File

@ -1,122 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
public final class RouteGuideProto {
private RouteGuideProto() {}
public static void registerAllExtensions(
com.google.protobuf.ExtensionRegistry registry) {
}
static final com.google.protobuf.Descriptors.Descriptor
internal_static_routeguide_Point_descriptor;
static final
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_routeguide_Point_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_routeguide_Rectangle_descriptor;
static final
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_routeguide_Rectangle_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_routeguide_Feature_descriptor;
static final
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_routeguide_Feature_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_routeguide_FeatureDatabase_descriptor;
static final
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_routeguide_FeatureDatabase_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_routeguide_RouteNote_descriptor;
static final
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_routeguide_RouteNote_fieldAccessorTable;
static final com.google.protobuf.Descriptors.Descriptor
internal_static_routeguide_RouteSummary_descriptor;
static final
com.google.protobuf.GeneratedMessage.FieldAccessorTable
internal_static_routeguide_RouteSummary_fieldAccessorTable;
public static com.google.protobuf.Descriptors.FileDescriptor
getDescriptor() {
return descriptor;
}
private static com.google.protobuf.Descriptors.FileDescriptor
descriptor;
static {
java.lang.String[] descriptorData = {
"\n\021route_guide.proto\022\nrouteguide\",\n\005Point" +
"\022\020\n\010latitude\030\001 \001(\005\022\021\n\tlongitude\030\002 \001(\005\"I\n" +
"\tRectangle\022\035\n\002lo\030\001 \001(\0132\021.routeguide.Poin" +
"t\022\035\n\002hi\030\002 \001(\0132\021.routeguide.Point\"<\n\007Feat" +
"ure\022\014\n\004name\030\001 \001(\t\022#\n\010location\030\002 \001(\0132\021.ro" +
"uteguide.Point\"7\n\017FeatureDatabase\022$\n\007fea" +
"ture\030\001 \003(\0132\023.routeguide.Feature\"A\n\tRoute" +
"Note\022#\n\010location\030\001 \001(\0132\021.routeguide.Poin" +
"t\022\017\n\007message\030\002 \001(\t\"b\n\014RouteSummary\022\023\n\013po" +
"int_count\030\001 \001(\005\022\025\n\rfeature_count\030\002 \001(\005\022\020",
"\n\010distance\030\003 \001(\005\022\024\n\014elapsed_time\030\004 \001(\0052\205" +
"\002\n\nRouteGuide\0226\n\nGetFeature\022\021.routeguide" +
".Point\032\023.routeguide.Feature\"\000\022>\n\014ListFea" +
"tures\022\025.routeguide.Rectangle\032\023.routeguid" +
"e.Feature\"\0000\001\022>\n\013RecordRoute\022\021.routeguid" +
"e.Point\032\030.routeguide.RouteSummary\"\000(\001\022?\n" +
"\tRouteChat\022\025.routeguide.RouteNote\032\025.rout" +
"eguide.RouteNote\"\000(\0010\001B6\n\033io.grpc.exampl" +
"es.routeguideB\017RouteGuideProtoP\001\242\002\003RTGb\006" +
"proto3"
};
com.google.protobuf.Descriptors.FileDescriptor.InternalDescriptorAssigner assigner =
new com.google.protobuf.Descriptors.FileDescriptor. InternalDescriptorAssigner() {
public com.google.protobuf.ExtensionRegistry assignDescriptors(
com.google.protobuf.Descriptors.FileDescriptor root) {
descriptor = root;
return null;
}
};
com.google.protobuf.Descriptors.FileDescriptor
.internalBuildGeneratedFileFrom(descriptorData,
new com.google.protobuf.Descriptors.FileDescriptor[] {
}, assigner);
internal_static_routeguide_Point_descriptor =
getDescriptor().getMessageTypes().get(0);
internal_static_routeguide_Point_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_routeguide_Point_descriptor,
new java.lang.String[] { "Latitude", "Longitude", });
internal_static_routeguide_Rectangle_descriptor =
getDescriptor().getMessageTypes().get(1);
internal_static_routeguide_Rectangle_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_routeguide_Rectangle_descriptor,
new java.lang.String[] { "Lo", "Hi", });
internal_static_routeguide_Feature_descriptor =
getDescriptor().getMessageTypes().get(2);
internal_static_routeguide_Feature_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_routeguide_Feature_descriptor,
new java.lang.String[] { "Name", "Location", });
internal_static_routeguide_FeatureDatabase_descriptor =
getDescriptor().getMessageTypes().get(3);
internal_static_routeguide_FeatureDatabase_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_routeguide_FeatureDatabase_descriptor,
new java.lang.String[] { "Feature", });
internal_static_routeguide_RouteNote_descriptor =
getDescriptor().getMessageTypes().get(4);
internal_static_routeguide_RouteNote_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_routeguide_RouteNote_descriptor,
new java.lang.String[] { "Location", "Message", });
internal_static_routeguide_RouteSummary_descriptor =
getDescriptor().getMessageTypes().get(5);
internal_static_routeguide_RouteSummary_fieldAccessorTable = new
com.google.protobuf.GeneratedMessage.FieldAccessorTable(
internal_static_routeguide_RouteSummary_descriptor,
new java.lang.String[] { "PointCount", "FeatureCount", "Distance", "ElapsedTime", });
}
// @@protoc_insertion_point(outer_class_scope)
}

View File

@ -1,693 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
/**
* <pre>
* A RouteNote is a message sent while at a given point.
* </pre>
*
* Protobuf type {@code routeguide.RouteNote}
*/
public final class RouteNote extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:routeguide.RouteNote)
RouteNoteOrBuilder {
// Use RouteNote.newBuilder() to construct.
private RouteNote(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
}
private RouteNote() {
message_ = "";
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private RouteNote(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 10: {
io.grpc.examples.routeguide.Point.Builder subBuilder = null;
if (location_ != null) {
subBuilder = location_.toBuilder();
}
location_ = input.readMessage(io.grpc.examples.routeguide.Point.parser(), extensionRegistry);
if (subBuilder != null) {
subBuilder.mergeFrom(location_);
location_ = subBuilder.buildPartial();
}
break;
}
case 18: {
java.lang.String s = input.readStringRequireUtf8();
message_ = s;
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_RouteNote_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_RouteNote_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.routeguide.RouteNote.class, io.grpc.examples.routeguide.RouteNote.Builder.class);
}
public static final int LOCATION_FIELD_NUMBER = 1;
private io.grpc.examples.routeguide.Point location_;
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
public boolean hasLocation() {
return location_ != null;
}
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
public io.grpc.examples.routeguide.Point getLocation() {
return location_ == null ? io.grpc.examples.routeguide.Point.getDefaultInstance() : location_;
}
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
public io.grpc.examples.routeguide.PointOrBuilder getLocationOrBuilder() {
return getLocation();
}
public static final int MESSAGE_FIELD_NUMBER = 2;
private volatile java.lang.Object message_;
/**
* <pre>
* The message to be sent.
* </pre>
*
* <code>optional string message = 2;</code>
*/
public java.lang.String getMessage() {
java.lang.Object ref = message_;
if (ref instanceof java.lang.String) {
return (java.lang.String) ref;
} else {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
message_ = s;
return s;
}
}
/**
* <pre>
* The message to be sent.
* </pre>
*
* <code>optional string message = 2;</code>
*/
public com.google.protobuf.ByteString
getMessageBytes() {
java.lang.Object ref = message_;
if (ref instanceof java.lang.String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (location_ != null) {
output.writeMessage(1, getLocation());
}
if (!getMessageBytes().isEmpty()) {
com.google.protobuf.GeneratedMessage.writeString(output, 2, message_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (location_ != null) {
size += com.google.protobuf.CodedOutputStream
.computeMessageSize(1, getLocation());
}
if (!getMessageBytes().isEmpty()) {
size += com.google.protobuf.GeneratedMessage.computeStringSize(2, message_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
public static io.grpc.examples.routeguide.RouteNote parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.routeguide.RouteNote parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.routeguide.RouteNote parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.routeguide.RouteNote parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.routeguide.RouteNote parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.RouteNote parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.routeguide.RouteNote parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.RouteNote parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.routeguide.RouteNote parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.RouteNote parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.examples.routeguide.RouteNote prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* A RouteNote is a message sent while at a given point.
* </pre>
*
* Protobuf type {@code routeguide.RouteNote}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:routeguide.RouteNote)
io.grpc.examples.routeguide.RouteNoteOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_RouteNote_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_RouteNote_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.routeguide.RouteNote.class, io.grpc.examples.routeguide.RouteNote.Builder.class);
}
// Construct using io.grpc.examples.routeguide.RouteNote.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
if (locationBuilder_ == null) {
location_ = null;
} else {
location_ = null;
locationBuilder_ = null;
}
message_ = "";
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_RouteNote_descriptor;
}
public io.grpc.examples.routeguide.RouteNote getDefaultInstanceForType() {
return io.grpc.examples.routeguide.RouteNote.getDefaultInstance();
}
public io.grpc.examples.routeguide.RouteNote build() {
io.grpc.examples.routeguide.RouteNote result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.examples.routeguide.RouteNote buildPartial() {
io.grpc.examples.routeguide.RouteNote result = new io.grpc.examples.routeguide.RouteNote(this);
if (locationBuilder_ == null) {
result.location_ = location_;
} else {
result.location_ = locationBuilder_.build();
}
result.message_ = message_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.examples.routeguide.RouteNote) {
return mergeFrom((io.grpc.examples.routeguide.RouteNote)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.examples.routeguide.RouteNote other) {
if (other == io.grpc.examples.routeguide.RouteNote.getDefaultInstance()) return this;
if (other.hasLocation()) {
mergeLocation(other.getLocation());
}
if (!other.getMessage().isEmpty()) {
message_ = other.message_;
onChanged();
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.examples.routeguide.RouteNote parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.examples.routeguide.RouteNote) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private io.grpc.examples.routeguide.Point location_ = null;
private com.google.protobuf.SingleFieldBuilder<
io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.Point.Builder, io.grpc.examples.routeguide.PointOrBuilder> locationBuilder_;
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
public boolean hasLocation() {
return locationBuilder_ != null || location_ != null;
}
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
public io.grpc.examples.routeguide.Point getLocation() {
if (locationBuilder_ == null) {
return location_ == null ? io.grpc.examples.routeguide.Point.getDefaultInstance() : location_;
} else {
return locationBuilder_.getMessage();
}
}
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
public Builder setLocation(io.grpc.examples.routeguide.Point value) {
if (locationBuilder_ == null) {
if (value == null) {
throw new NullPointerException();
}
location_ = value;
onChanged();
} else {
locationBuilder_.setMessage(value);
}
return this;
}
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
public Builder setLocation(
io.grpc.examples.routeguide.Point.Builder builderForValue) {
if (locationBuilder_ == null) {
location_ = builderForValue.build();
onChanged();
} else {
locationBuilder_.setMessage(builderForValue.build());
}
return this;
}
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
public Builder mergeLocation(io.grpc.examples.routeguide.Point value) {
if (locationBuilder_ == null) {
if (location_ != null) {
location_ =
io.grpc.examples.routeguide.Point.newBuilder(location_).mergeFrom(value).buildPartial();
} else {
location_ = value;
}
onChanged();
} else {
locationBuilder_.mergeFrom(value);
}
return this;
}
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
public Builder clearLocation() {
if (locationBuilder_ == null) {
location_ = null;
onChanged();
} else {
location_ = null;
locationBuilder_ = null;
}
return this;
}
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
public io.grpc.examples.routeguide.Point.Builder getLocationBuilder() {
onChanged();
return getLocationFieldBuilder().getBuilder();
}
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
public io.grpc.examples.routeguide.PointOrBuilder getLocationOrBuilder() {
if (locationBuilder_ != null) {
return locationBuilder_.getMessageOrBuilder();
} else {
return location_ == null ?
io.grpc.examples.routeguide.Point.getDefaultInstance() : location_;
}
}
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
private com.google.protobuf.SingleFieldBuilder<
io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.Point.Builder, io.grpc.examples.routeguide.PointOrBuilder>
getLocationFieldBuilder() {
if (locationBuilder_ == null) {
locationBuilder_ = new com.google.protobuf.SingleFieldBuilder<
io.grpc.examples.routeguide.Point, io.grpc.examples.routeguide.Point.Builder, io.grpc.examples.routeguide.PointOrBuilder>(
getLocation(),
getParentForChildren(),
isClean());
location_ = null;
}
return locationBuilder_;
}
private java.lang.Object message_ = "";
/**
* <pre>
* The message to be sent.
* </pre>
*
* <code>optional string message = 2;</code>
*/
public java.lang.String getMessage() {
java.lang.Object ref = message_;
if (!(ref instanceof java.lang.String)) {
com.google.protobuf.ByteString bs =
(com.google.protobuf.ByteString) ref;
java.lang.String s = bs.toStringUtf8();
message_ = s;
return s;
} else {
return (java.lang.String) ref;
}
}
/**
* <pre>
* The message to be sent.
* </pre>
*
* <code>optional string message = 2;</code>
*/
public com.google.protobuf.ByteString
getMessageBytes() {
java.lang.Object ref = message_;
if (ref instanceof String) {
com.google.protobuf.ByteString b =
com.google.protobuf.ByteString.copyFromUtf8(
(java.lang.String) ref);
message_ = b;
return b;
} else {
return (com.google.protobuf.ByteString) ref;
}
}
/**
* <pre>
* The message to be sent.
* </pre>
*
* <code>optional string message = 2;</code>
*/
public Builder setMessage(
java.lang.String value) {
if (value == null) {
throw new NullPointerException();
}
message_ = value;
onChanged();
return this;
}
/**
* <pre>
* The message to be sent.
* </pre>
*
* <code>optional string message = 2;</code>
*/
public Builder clearMessage() {
message_ = getDefaultInstance().getMessage();
onChanged();
return this;
}
/**
* <pre>
* The message to be sent.
* </pre>
*
* <code>optional string message = 2;</code>
*/
public Builder setMessageBytes(
com.google.protobuf.ByteString value) {
if (value == null) {
throw new NullPointerException();
}
checkByteStringIsUtf8(value);
message_ = value;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:routeguide.RouteNote)
}
// @@protoc_insertion_point(class_scope:routeguide.RouteNote)
private static final io.grpc.examples.routeguide.RouteNote DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.examples.routeguide.RouteNote();
}
public static io.grpc.examples.routeguide.RouteNote getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<RouteNote>
PARSER = new com.google.protobuf.AbstractParser<RouteNote>() {
public RouteNote parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new RouteNote(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<RouteNote> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<RouteNote> getParserForType() {
return PARSER;
}
public io.grpc.examples.routeguide.RouteNote getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -1,52 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
public interface RouteNoteOrBuilder extends
// @@protoc_insertion_point(interface_extends:routeguide.RouteNote)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
boolean hasLocation();
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
io.grpc.examples.routeguide.Point getLocation();
/**
* <pre>
* The location from which the message is sent.
* </pre>
*
* <code>optional .routeguide.Point location = 1;</code>
*/
io.grpc.examples.routeguide.PointOrBuilder getLocationOrBuilder();
/**
* <pre>
* The message to be sent.
* </pre>
*
* <code>optional string message = 2;</code>
*/
java.lang.String getMessage();
/**
* <pre>
* The message to be sent.
* </pre>
*
* <code>optional string message = 2;</code>
*/
com.google.protobuf.ByteString
getMessageBytes();
}

View File

@ -1,608 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
/**
* <pre>
* A RouteSummary is received in response to a RecordRoute rpc.
* It contains the number of individual points received, the number of
* detected features, and the total distance covered as the cumulative sum of
* the distance between each point.
* </pre>
*
* Protobuf type {@code routeguide.RouteSummary}
*/
public final class RouteSummary extends
com.google.protobuf.GeneratedMessage implements
// @@protoc_insertion_point(message_implements:routeguide.RouteSummary)
RouteSummaryOrBuilder {
// Use RouteSummary.newBuilder() to construct.
private RouteSummary(com.google.protobuf.GeneratedMessage.Builder<?> builder) {
super(builder);
}
private RouteSummary() {
pointCount_ = 0;
featureCount_ = 0;
distance_ = 0;
elapsedTime_ = 0;
}
@java.lang.Override
public final com.google.protobuf.UnknownFieldSet
getUnknownFields() {
return com.google.protobuf.UnknownFieldSet.getDefaultInstance();
}
private RouteSummary(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
this();
int mutable_bitField0_ = 0;
try {
boolean done = false;
while (!done) {
int tag = input.readTag();
switch (tag) {
case 0:
done = true;
break;
default: {
if (!input.skipField(tag)) {
done = true;
}
break;
}
case 8: {
pointCount_ = input.readInt32();
break;
}
case 16: {
featureCount_ = input.readInt32();
break;
}
case 24: {
distance_ = input.readInt32();
break;
}
case 32: {
elapsedTime_ = input.readInt32();
break;
}
}
}
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
throw e.setUnfinishedMessage(this);
} catch (java.io.IOException e) {
throw new com.google.protobuf.InvalidProtocolBufferException(
e).setUnfinishedMessage(this);
} finally {
makeExtensionsImmutable();
}
}
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_RouteSummary_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_RouteSummary_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.routeguide.RouteSummary.class, io.grpc.examples.routeguide.RouteSummary.Builder.class);
}
public static final int POINT_COUNT_FIELD_NUMBER = 1;
private int pointCount_;
/**
* <pre>
* The number of points received.
* </pre>
*
* <code>optional int32 point_count = 1;</code>
*/
public int getPointCount() {
return pointCount_;
}
public static final int FEATURE_COUNT_FIELD_NUMBER = 2;
private int featureCount_;
/**
* <pre>
* The number of known features passed while traversing the route.
* </pre>
*
* <code>optional int32 feature_count = 2;</code>
*/
public int getFeatureCount() {
return featureCount_;
}
public static final int DISTANCE_FIELD_NUMBER = 3;
private int distance_;
/**
* <pre>
* The distance covered in metres.
* </pre>
*
* <code>optional int32 distance = 3;</code>
*/
public int getDistance() {
return distance_;
}
public static final int ELAPSED_TIME_FIELD_NUMBER = 4;
private int elapsedTime_;
/**
* <pre>
* The duration of the traversal in seconds.
* </pre>
*
* <code>optional int32 elapsed_time = 4;</code>
*/
public int getElapsedTime() {
return elapsedTime_;
}
private byte memoizedIsInitialized = -1;
public final boolean isInitialized() {
byte isInitialized = memoizedIsInitialized;
if (isInitialized == 1) return true;
if (isInitialized == 0) return false;
memoizedIsInitialized = 1;
return true;
}
public void writeTo(com.google.protobuf.CodedOutputStream output)
throws java.io.IOException {
if (pointCount_ != 0) {
output.writeInt32(1, pointCount_);
}
if (featureCount_ != 0) {
output.writeInt32(2, featureCount_);
}
if (distance_ != 0) {
output.writeInt32(3, distance_);
}
if (elapsedTime_ != 0) {
output.writeInt32(4, elapsedTime_);
}
}
public int getSerializedSize() {
int size = memoizedSize;
if (size != -1) return size;
size = 0;
if (pointCount_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(1, pointCount_);
}
if (featureCount_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(2, featureCount_);
}
if (distance_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(3, distance_);
}
if (elapsedTime_ != 0) {
size += com.google.protobuf.CodedOutputStream
.computeInt32Size(4, elapsedTime_);
}
memoizedSize = size;
return size;
}
private static final long serialVersionUID = 0L;
public static io.grpc.examples.routeguide.RouteSummary parseFrom(
com.google.protobuf.ByteString data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.routeguide.RouteSummary parseFrom(
com.google.protobuf.ByteString data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.routeguide.RouteSummary parseFrom(byte[] data)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data);
}
public static io.grpc.examples.routeguide.RouteSummary parseFrom(
byte[] data,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return PARSER.parseFrom(data, extensionRegistry);
}
public static io.grpc.examples.routeguide.RouteSummary parseFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.RouteSummary parseFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.routeguide.RouteSummary parseDelimitedFrom(java.io.InputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.RouteSummary parseDelimitedFrom(
java.io.InputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseDelimitedWithIOException(PARSER, input, extensionRegistry);
}
public static io.grpc.examples.routeguide.RouteSummary parseFrom(
com.google.protobuf.CodedInputStream input)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input);
}
public static io.grpc.examples.routeguide.RouteSummary parseFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
return com.google.protobuf.GeneratedMessage
.parseWithIOException(PARSER, input, extensionRegistry);
}
public Builder newBuilderForType() { return newBuilder(); }
public static Builder newBuilder() {
return DEFAULT_INSTANCE.toBuilder();
}
public static Builder newBuilder(io.grpc.examples.routeguide.RouteSummary prototype) {
return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype);
}
public Builder toBuilder() {
return this == DEFAULT_INSTANCE
? new Builder() : new Builder().mergeFrom(this);
}
@java.lang.Override
protected Builder newBuilderForType(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
Builder builder = new Builder(parent);
return builder;
}
/**
* <pre>
* A RouteSummary is received in response to a RecordRoute rpc.
* It contains the number of individual points received, the number of
* detected features, and the total distance covered as the cumulative sum of
* the distance between each point.
* </pre>
*
* Protobuf type {@code routeguide.RouteSummary}
*/
public static final class Builder extends
com.google.protobuf.GeneratedMessage.Builder<Builder> implements
// @@protoc_insertion_point(builder_implements:routeguide.RouteSummary)
io.grpc.examples.routeguide.RouteSummaryOrBuilder {
public static final com.google.protobuf.Descriptors.Descriptor
getDescriptor() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_RouteSummary_descriptor;
}
protected com.google.protobuf.GeneratedMessage.FieldAccessorTable
internalGetFieldAccessorTable() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_RouteSummary_fieldAccessorTable
.ensureFieldAccessorsInitialized(
io.grpc.examples.routeguide.RouteSummary.class, io.grpc.examples.routeguide.RouteSummary.Builder.class);
}
// Construct using io.grpc.examples.routeguide.RouteSummary.newBuilder()
private Builder() {
maybeForceBuilderInitialization();
}
private Builder(
com.google.protobuf.GeneratedMessage.BuilderParent parent) {
super(parent);
maybeForceBuilderInitialization();
}
private void maybeForceBuilderInitialization() {
if (com.google.protobuf.GeneratedMessage.alwaysUseFieldBuilders) {
}
}
public Builder clear() {
super.clear();
pointCount_ = 0;
featureCount_ = 0;
distance_ = 0;
elapsedTime_ = 0;
return this;
}
public com.google.protobuf.Descriptors.Descriptor
getDescriptorForType() {
return io.grpc.examples.routeguide.RouteGuideProto.internal_static_routeguide_RouteSummary_descriptor;
}
public io.grpc.examples.routeguide.RouteSummary getDefaultInstanceForType() {
return io.grpc.examples.routeguide.RouteSummary.getDefaultInstance();
}
public io.grpc.examples.routeguide.RouteSummary build() {
io.grpc.examples.routeguide.RouteSummary result = buildPartial();
if (!result.isInitialized()) {
throw newUninitializedMessageException(result);
}
return result;
}
public io.grpc.examples.routeguide.RouteSummary buildPartial() {
io.grpc.examples.routeguide.RouteSummary result = new io.grpc.examples.routeguide.RouteSummary(this);
result.pointCount_ = pointCount_;
result.featureCount_ = featureCount_;
result.distance_ = distance_;
result.elapsedTime_ = elapsedTime_;
onBuilt();
return result;
}
public Builder mergeFrom(com.google.protobuf.Message other) {
if (other instanceof io.grpc.examples.routeguide.RouteSummary) {
return mergeFrom((io.grpc.examples.routeguide.RouteSummary)other);
} else {
super.mergeFrom(other);
return this;
}
}
public Builder mergeFrom(io.grpc.examples.routeguide.RouteSummary other) {
if (other == io.grpc.examples.routeguide.RouteSummary.getDefaultInstance()) return this;
if (other.getPointCount() != 0) {
setPointCount(other.getPointCount());
}
if (other.getFeatureCount() != 0) {
setFeatureCount(other.getFeatureCount());
}
if (other.getDistance() != 0) {
setDistance(other.getDistance());
}
if (other.getElapsedTime() != 0) {
setElapsedTime(other.getElapsedTime());
}
onChanged();
return this;
}
public final boolean isInitialized() {
return true;
}
public Builder mergeFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws java.io.IOException {
io.grpc.examples.routeguide.RouteSummary parsedMessage = null;
try {
parsedMessage = PARSER.parsePartialFrom(input, extensionRegistry);
} catch (com.google.protobuf.InvalidProtocolBufferException e) {
parsedMessage = (io.grpc.examples.routeguide.RouteSummary) e.getUnfinishedMessage();
throw e.unwrapIOException();
} finally {
if (parsedMessage != null) {
mergeFrom(parsedMessage);
}
}
return this;
}
private int pointCount_ ;
/**
* <pre>
* The number of points received.
* </pre>
*
* <code>optional int32 point_count = 1;</code>
*/
public int getPointCount() {
return pointCount_;
}
/**
* <pre>
* The number of points received.
* </pre>
*
* <code>optional int32 point_count = 1;</code>
*/
public Builder setPointCount(int value) {
pointCount_ = value;
onChanged();
return this;
}
/**
* <pre>
* The number of points received.
* </pre>
*
* <code>optional int32 point_count = 1;</code>
*/
public Builder clearPointCount() {
pointCount_ = 0;
onChanged();
return this;
}
private int featureCount_ ;
/**
* <pre>
* The number of known features passed while traversing the route.
* </pre>
*
* <code>optional int32 feature_count = 2;</code>
*/
public int getFeatureCount() {
return featureCount_;
}
/**
* <pre>
* The number of known features passed while traversing the route.
* </pre>
*
* <code>optional int32 feature_count = 2;</code>
*/
public Builder setFeatureCount(int value) {
featureCount_ = value;
onChanged();
return this;
}
/**
* <pre>
* The number of known features passed while traversing the route.
* </pre>
*
* <code>optional int32 feature_count = 2;</code>
*/
public Builder clearFeatureCount() {
featureCount_ = 0;
onChanged();
return this;
}
private int distance_ ;
/**
* <pre>
* The distance covered in metres.
* </pre>
*
* <code>optional int32 distance = 3;</code>
*/
public int getDistance() {
return distance_;
}
/**
* <pre>
* The distance covered in metres.
* </pre>
*
* <code>optional int32 distance = 3;</code>
*/
public Builder setDistance(int value) {
distance_ = value;
onChanged();
return this;
}
/**
* <pre>
* The distance covered in metres.
* </pre>
*
* <code>optional int32 distance = 3;</code>
*/
public Builder clearDistance() {
distance_ = 0;
onChanged();
return this;
}
private int elapsedTime_ ;
/**
* <pre>
* The duration of the traversal in seconds.
* </pre>
*
* <code>optional int32 elapsed_time = 4;</code>
*/
public int getElapsedTime() {
return elapsedTime_;
}
/**
* <pre>
* The duration of the traversal in seconds.
* </pre>
*
* <code>optional int32 elapsed_time = 4;</code>
*/
public Builder setElapsedTime(int value) {
elapsedTime_ = value;
onChanged();
return this;
}
/**
* <pre>
* The duration of the traversal in seconds.
* </pre>
*
* <code>optional int32 elapsed_time = 4;</code>
*/
public Builder clearElapsedTime() {
elapsedTime_ = 0;
onChanged();
return this;
}
public final Builder setUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
public final Builder mergeUnknownFields(
final com.google.protobuf.UnknownFieldSet unknownFields) {
return this;
}
// @@protoc_insertion_point(builder_scope:routeguide.RouteSummary)
}
// @@protoc_insertion_point(class_scope:routeguide.RouteSummary)
private static final io.grpc.examples.routeguide.RouteSummary DEFAULT_INSTANCE;
static {
DEFAULT_INSTANCE = new io.grpc.examples.routeguide.RouteSummary();
}
public static io.grpc.examples.routeguide.RouteSummary getDefaultInstance() {
return DEFAULT_INSTANCE;
}
private static final com.google.protobuf.Parser<RouteSummary>
PARSER = new com.google.protobuf.AbstractParser<RouteSummary>() {
public RouteSummary parsePartialFrom(
com.google.protobuf.CodedInputStream input,
com.google.protobuf.ExtensionRegistryLite extensionRegistry)
throws com.google.protobuf.InvalidProtocolBufferException {
return new RouteSummary(input, extensionRegistry);
}
};
public static com.google.protobuf.Parser<RouteSummary> parser() {
return PARSER;
}
@java.lang.Override
public com.google.protobuf.Parser<RouteSummary> getParserForType() {
return PARSER;
}
public io.grpc.examples.routeguide.RouteSummary getDefaultInstanceForType() {
return DEFAULT_INSTANCE;
}
}

View File

@ -1,45 +0,0 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: route_guide.proto
package io.grpc.examples.routeguide;
public interface RouteSummaryOrBuilder extends
// @@protoc_insertion_point(interface_extends:routeguide.RouteSummary)
com.google.protobuf.MessageOrBuilder {
/**
* <pre>
* The number of points received.
* </pre>
*
* <code>optional int32 point_count = 1;</code>
*/
int getPointCount();
/**
* <pre>
* The number of known features passed while traversing the route.
* </pre>
*
* <code>optional int32 feature_count = 2;</code>
*/
int getFeatureCount();
/**
* <pre>
* The distance covered in metres.
* </pre>
*
* <code>optional int32 distance = 3;</code>
*/
int getDistance();
/**
* <pre>
* The duration of the traversal in seconds.
* </pre>
*
* <code>optional int32 elapsed_time = 4;</code>
*/
int getElapsedTime();
}

View File

@ -13,7 +13,6 @@ include ":grpc-interop-testing"
include ":grpc-all"
include ":grpc-benchmarks"
include ":grpc-services"
include ":grpc-examples"
project(':grpc-core').projectDir = "$rootDir/core" as File
project(':grpc-stub').projectDir = "$rootDir/stub" as File
@ -29,7 +28,6 @@ project(':grpc-interop-testing').projectDir = "$rootDir/interop-testing" as File
project(':grpc-all').projectDir = "$rootDir/all" as File
project(':grpc-benchmarks').projectDir = "$rootDir/benchmarks" as File
project(':grpc-services').projectDir = "$rootDir/services" as File
project(':grpc-examples').projectDir = "$rootDir/examples" as File
if (settings.hasProperty('skipCodegen') && skipCodegen.toBoolean()) {
println '*** Skipping the build of codegen and compilation of proto files because skipCodegen=true'