From 9b2dfad4f1c6f0f4401cefad20052bb24a8c9aef Mon Sep 17 00:00:00 2001 From: "Philip K. Warren" Date: Tue, 5 Mar 2024 12:33:04 -0600 Subject: [PATCH] Update to protovalidate 0.6.1 (#106) Update protovalidate-java to support the latest rules in protovalidate 0.6.1. Add the isHostAndPort overload and apply additional fixes from protovalidate-go to the Java implementation. --- build.gradle.kts | 7 +- .../conformance/cases/IgnoreProto2Proto.java | 762 ++++++ .../conformance/cases/IgnoreProto3Proto.java | 647 +++++ .../cases/Int64BigConstraints.java | 1225 +++++++++ .../cases/Int64BigConstraintsOrBuilder.java | 85 + .../conformance/cases/MessagesProto.java | 2 +- .../conformance/cases/NumbersProto.java | 532 ++-- .../cases/Proto2MapIgnoreDefault.java | 680 +++++ .../Proto2MapIgnoreDefaultOrBuilder.java | 41 + .../cases/Proto2MapIgnoreEmpty.java | 680 +++++ .../cases/Proto2MapIgnoreEmptyOrBuilder.java | 41 + .../cases/Proto2MapIgnoreUnspecified.java | 680 +++++ .../Proto2MapIgnoreUnspecifiedOrBuilder.java | 41 + .../cases/Proto2MapKeyIgnoreDefault.java | 680 +++++ .../Proto2MapKeyIgnoreDefaultOrBuilder.java | 41 + .../cases/Proto2MapKeyIgnoreEmpty.java | 680 +++++ .../Proto2MapKeyIgnoreEmptyOrBuilder.java | 41 + .../cases/Proto2MapKeyIgnoreUnspecified.java | 680 +++++ ...roto2MapKeyIgnoreUnspecifiedOrBuilder.java | 41 + .../cases/Proto2MapValueIgnoreDefault.java | 680 +++++ .../Proto2MapValueIgnoreDefaultOrBuilder.java | 41 + .../cases/Proto2MapValueIgnoreEmpty.java | 680 +++++ .../Proto2MapValueIgnoreEmptyOrBuilder.java | 41 + .../Proto2MapValueIgnoreUnspecified.java | 680 +++++ ...to2MapValueIgnoreUnspecifiedOrBuilder.java | 41 + .../Proto2MessageOptionalIgnoreDefault.java | 1182 ++++++++ ...MessageOptionalIgnoreDefaultOrBuilder.java | 24 + .../Proto2MessageOptionalIgnoreEmpty.java | 1182 ++++++++ ...o2MessageOptionalIgnoreEmptyOrBuilder.java | 24 + ...roto2MessageOptionalIgnoreUnspecified.java | 1182 ++++++++ ...ageOptionalIgnoreUnspecifiedOrBuilder.java | 24 + .../Proto2MessageRequiredIgnoreDefault.java | 1189 ++++++++ ...MessageRequiredIgnoreDefaultOrBuilder.java | 24 + .../Proto2MessageRequiredIgnoreEmpty.java | 1189 ++++++++ ...o2MessageRequiredIgnoreEmptyOrBuilder.java | 24 + ...roto2MessageRequiredIgnoreUnspecified.java | 1189 ++++++++ ...ageRequiredIgnoreUnspecifiedOrBuilder.java | 24 + .../cases/Proto2OneofIgnoreDefault.java | 571 ++++ .../Proto2OneofIgnoreDefaultOrBuilder.java | 22 + .../Proto2OneofIgnoreDefaultWithDefault.java | 571 ++++ ...neofIgnoreDefaultWithDefaultOrBuilder.java | 22 + .../cases/Proto2OneofIgnoreEmpty.java | 571 ++++ .../Proto2OneofIgnoreEmptyOrBuilder.java | 22 + .../Proto2OneofIgnoreEmptyWithDefault.java | 571 ++++ ...2OneofIgnoreEmptyWithDefaultOrBuilder.java | 22 + .../cases/Proto2OneofIgnoreUnspecified.java | 571 ++++ ...Proto2OneofIgnoreUnspecifiedOrBuilder.java | 22 + ...oto2OneofIgnoreUnspecifiedWithDefault.java | 571 ++++ ...IgnoreUnspecifiedWithDefaultOrBuilder.java | 22 + .../cases/Proto2RepeatedIgnoreDefault.java | 569 ++++ .../Proto2RepeatedIgnoreDefaultOrBuilder.java | 26 + .../cases/Proto2RepeatedIgnoreEmpty.java | 569 ++++ .../Proto2RepeatedIgnoreEmptyOrBuilder.java | 26 + .../Proto2RepeatedIgnoreUnspecified.java | 569 ++++ ...to2RepeatedIgnoreUnspecifiedOrBuilder.java | 26 + .../Proto2RepeatedItemIgnoreDefault.java | 569 ++++ ...to2RepeatedItemIgnoreDefaultOrBuilder.java | 26 + .../cases/Proto2RepeatedItemIgnoreEmpty.java | 569 ++++ ...roto2RepeatedItemIgnoreEmptyOrBuilder.java | 26 + .../Proto2RepeatedItemIgnoreUnspecified.java | 569 ++++ ...epeatedItemIgnoreUnspecifiedOrBuilder.java | 26 + .../Proto2ScalarOptionalIgnoreDefault.java | 496 ++++ ...2ScalarOptionalIgnoreDefaultOrBuilder.java | 20 + ...calarOptionalIgnoreDefaultWithDefault.java | 497 ++++ ...onalIgnoreDefaultWithDefaultOrBuilder.java | 20 + .../Proto2ScalarOptionalIgnoreEmpty.java | 496 ++++ ...to2ScalarOptionalIgnoreEmptyOrBuilder.java | 20 + ...2ScalarOptionalIgnoreEmptyWithDefault.java | 497 ++++ ...tionalIgnoreEmptyWithDefaultOrBuilder.java | 20 + ...Proto2ScalarOptionalIgnoreUnspecified.java | 496 ++++ ...larOptionalIgnoreUnspecifiedOrBuilder.java | 20 + ...rOptionalIgnoreUnspecifiedWithDefault.java | 497 ++++ ...IgnoreUnspecifiedWithDefaultOrBuilder.java | 20 + .../Proto2ScalarRequiredIgnoreDefault.java | 503 ++++ ...2ScalarRequiredIgnoreDefaultOrBuilder.java | 20 + ...calarRequiredIgnoreDefaultWithDefault.java | 504 ++++ ...iredIgnoreDefaultWithDefaultOrBuilder.java | 20 + .../Proto2ScalarRequiredIgnoreEmpty.java | 503 ++++ ...to2ScalarRequiredIgnoreEmptyOrBuilder.java | 20 + ...2ScalarRequiredIgnoreEmptyWithDefault.java | 504 ++++ ...quiredIgnoreEmptyWithDefaultOrBuilder.java | 20 + ...Proto2ScalarRequiredIgnoreUnspecified.java | 503 ++++ ...larRequiredIgnoreUnspecifiedOrBuilder.java | 20 + ...rRequiredIgnoreUnspecifiedWithDefault.java | 504 ++++ ...IgnoreUnspecifiedWithDefaultOrBuilder.java | 20 + .../cases/Proto3MapIgnoreDefault.java | 680 +++++ .../Proto3MapIgnoreDefaultOrBuilder.java | 41 + .../cases/Proto3MapIgnoreEmpty.java | 680 +++++ .../cases/Proto3MapIgnoreEmptyOrBuilder.java | 41 + .../cases/Proto3MapIgnoreUnspecified.java | 680 +++++ .../Proto3MapIgnoreUnspecifiedOrBuilder.java | 41 + .../cases/Proto3MapKeyIgnoreDefault.java | 680 +++++ .../Proto3MapKeyIgnoreDefaultOrBuilder.java | 41 + .../cases/Proto3MapKeyIgnoreEmpty.java | 680 +++++ .../Proto3MapKeyIgnoreEmptyOrBuilder.java | 41 + .../cases/Proto3MapKeyIgnoreUnspecified.java | 680 +++++ ...roto3MapKeyIgnoreUnspecifiedOrBuilder.java | 41 + .../cases/Proto3MapValueIgnoreDefault.java | 680 +++++ .../Proto3MapValueIgnoreDefaultOrBuilder.java | 41 + .../cases/Proto3MapValueIgnoreEmpty.java | 680 +++++ .../Proto3MapValueIgnoreEmptyOrBuilder.java | 41 + .../Proto3MapValueIgnoreUnspecified.java | 680 +++++ ...to3MapValueIgnoreUnspecifiedOrBuilder.java | 41 + .../cases/Proto3MessageIgnoreDefault.java | 1179 ++++++++ .../Proto3MessageIgnoreDefaultOrBuilder.java | 24 + .../cases/Proto3MessageIgnoreEmpty.java | 1179 ++++++++ .../Proto3MessageIgnoreEmptyOrBuilder.java | 24 + .../cases/Proto3MessageIgnoreUnspecified.java | 1179 ++++++++ ...oto3MessageIgnoreUnspecifiedOrBuilder.java | 24 + .../Proto3MessageOptionalIgnoreDefault.java | 1179 ++++++++ ...MessageOptionalIgnoreDefaultOrBuilder.java | 24 + .../Proto3MessageOptionalIgnoreEmpty.java | 1179 ++++++++ ...o3MessageOptionalIgnoreEmptyOrBuilder.java | 24 + ...roto3MessageOptionalIgnoreUnspecified.java | 1179 ++++++++ ...ageOptionalIgnoreUnspecifiedOrBuilder.java | 24 + .../cases/Proto3OneofIgnoreDefault.java | 571 ++++ .../Proto3OneofIgnoreDefaultOrBuilder.java | 22 + .../cases/Proto3OneofIgnoreEmpty.java | 571 ++++ .../Proto3OneofIgnoreEmptyOrBuilder.java | 22 + .../cases/Proto3OneofIgnoreUnspecified.java | 571 ++++ ...Proto3OneofIgnoreUnspecifiedOrBuilder.java | 22 + .../cases/Proto3RepeatedIgnoreDefault.java | 580 ++++ .../Proto3RepeatedIgnoreDefaultOrBuilder.java | 26 + .../cases/Proto3RepeatedIgnoreEmpty.java | 580 ++++ .../Proto3RepeatedIgnoreEmptyOrBuilder.java | 26 + .../Proto3RepeatedIgnoreUnspecified.java | 580 ++++ ...to3RepeatedIgnoreUnspecifiedOrBuilder.java | 26 + .../Proto3RepeatedItemIgnoreDefault.java | 580 ++++ ...to3RepeatedItemIgnoreDefaultOrBuilder.java | 26 + .../cases/Proto3RepeatedItemIgnoreEmpty.java | 580 ++++ ...roto3RepeatedItemIgnoreEmptyOrBuilder.java | 26 + .../Proto3RepeatedItemIgnoreUnspecified.java | 580 ++++ ...epeatedItemIgnoreUnspecifiedOrBuilder.java | 26 + .../cases/Proto3ScalarIgnoreDefault.java | 471 ++++ .../Proto3ScalarIgnoreDefaultOrBuilder.java | 15 + .../cases/Proto3ScalarIgnoreEmpty.java | 471 ++++ .../Proto3ScalarIgnoreEmptyOrBuilder.java | 15 + .../cases/Proto3ScalarIgnoreUnspecified.java | 471 ++++ ...roto3ScalarIgnoreUnspecifiedOrBuilder.java | 15 + .../Proto3ScalarOptionalIgnoreDefault.java | 496 ++++ ...3ScalarOptionalIgnoreDefaultOrBuilder.java | 20 + .../Proto3ScalarOptionalIgnoreEmpty.java | 496 ++++ ...to3ScalarOptionalIgnoreEmptyOrBuilder.java | 20 + ...Proto3ScalarOptionalIgnoreUnspecified.java | 496 ++++ ...larOptionalIgnoreUnspecifiedOrBuilder.java | 20 + .../conformance/cases/RepeatedProto.java | 2 +- .../cases/StringHostAndOptionalPort.java | 541 ++++ .../StringHostAndOptionalPortOrBuilder.java | 21 + .../conformance/cases/StringHostAndPort.java | 541 ++++ .../cases/StringHostAndPortOrBuilder.java | 21 + .../conformance/cases/StringsProto.java | 39 +- gradle.properties | 2 +- .../exceptions/CompilationException.java | 11 + .../exceptions/ExecutionException.java | 5 + .../exceptions/ValidationException.java | 11 + .../internal/celext/CustomDeclarations.java | 8 + .../internal/celext/CustomOverload.java | 65 +- .../internal/celext/ValidateLibrary.java | 3 + .../internal/constraints/ConstraintCache.java | 6 +- .../constraints/DescriptorMappings.java | 10 +- .../internal/evaluator/Evaluator.java | 14 +- .../internal/evaluator/EvaluatorBuilder.java | 129 +- .../internal/evaluator/FieldEvaluator.java | 17 +- .../internal/expression/CelPrograms.java | 6 +- .../internal/expression/NowVariable.java | 3 + .../internal/expression/Variable.java | 9 +- .../java/build/buf/validate/EnumRules.java | 40 +- .../buf/validate/EnumRulesOrBuilder.java | 12 +- .../build/buf/validate/FieldConstraints.java | 536 ++-- .../validate/FieldConstraintsOrBuilder.java | 100 +- src/main/java/build/buf/validate/Ignore.java | 467 ++++ .../java/build/buf/validate/KnownRegex.java | 2 +- .../java/build/buf/validate/StringRules.java | 174 +- .../buf/validate/StringRulesOrBuilder.java | 35 +- .../build/buf/validate/ValidateProto.java | 2393 +++++++++-------- .../resources/buf/validate/validate.proto | 532 +++- .../internal/celext/CustomOverloadTest.java | 36 + src/test/resources/proto/buf.lock | 4 +- src/test/resources/proto/buf.yaml | 2 +- 179 files changed, 56399 insertions(+), 1900 deletions(-) create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/IgnoreProto2Proto.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/IgnoreProto3Proto.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Int64BigConstraints.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Int64BigConstraintsOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefaultWithDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefaultWithDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmptyWithDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmptyWithDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecifiedWithDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecifiedWithDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefaultWithDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefaultWithDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmptyWithDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmptyWithDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecifiedWithDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecifiedWithDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefaultWithDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefaultWithDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmptyWithDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmptyWithDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecifiedWithDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecifiedWithDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreDefault.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreDefaultOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreEmpty.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreEmptyOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreUnspecified.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreUnspecifiedOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndOptionalPort.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndOptionalPortOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndPort.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndPortOrBuilder.java create mode 100644 src/main/java/build/buf/validate/Ignore.java diff --git a/build.gradle.kts b/build.gradle.kts index 856d34be..55b0c67d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -153,9 +153,10 @@ tasks.withType { } tasks.withType { - // TODO: Enable when Javadoc changes are final -// val stdOptions = options as StandardJavadocDocletOptions -// stdOptions.addBooleanOption("Xwerror", true) + val stdOptions = options as StandardJavadocDocletOptions + stdOptions.addBooleanOption("Xwerror", true) + // Ignore warnings for generated code. + stdOptions.addBooleanOption("Xdoclint/package:-build.buf.validate,-build.buf.validate.priv", true) } tasks.withType { diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/IgnoreProto2Proto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/IgnoreProto2Proto.java new file mode 100644 index 00000000..db8309c0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/IgnoreProto2Proto.java @@ -0,0 +1,762 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public final class IgnoreProto2Proto { + private IgnoreProto2Proto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecifiedWithDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecifiedWithDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmptyWithDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmptyWithDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefaultWithDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefaultWithDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecifiedWithDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecifiedWithDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmptyWithDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmptyWithDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefaultWithDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefaultWithDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecifiedWithDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecifiedWithDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmptyWithDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmptyWithDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefaultWithDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefaultWithDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_ValEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n2buf/validate/conformance/cases/ignore_" + + "proto2.proto\022\036buf.validate.conformance.c" + + "ases\032\033buf/validate/validate.proto\"B\n%Pro" + + "to2ScalarOptionalIgnoreUnspecified\022\031\n\003va" + + "l\030\001 \001(\005B\007\272H\004\032\002 \000R\003val\"R\n0Proto2ScalarOpt" + + "ionalIgnoreUnspecifiedWithDefault\022\036\n\003val" + + "\030\001 \001(\005:\003-42B\007\272H\004\032\002 \000R\003val\"?\n\037Proto2Scala" + + "rOptionalIgnoreEmpty\022\034\n\003val\030\001 \001(\005B\n\272H\007\032\002" + + " \000\330\001\001R\003val\"O\n*Proto2ScalarOptionalIgnore" + + "EmptyWithDefault\022!\n\003val\030\001 \001(\005:\003-42B\n\272H\007\032" + + "\002 \000\330\001\001R\003val\"A\n!Proto2ScalarOptionalIgnor" + + "eDefault\022\034\n\003val\030\001 \001(\005B\n\272H\007\032\002 \000\330\001\002R\003val\"Q" + + "\n,Proto2ScalarOptionalIgnoreDefaultWithD" + + "efault\022!\n\003val\030\001 \001(\005:\003-42B\n\272H\007\032\002 \000\330\001\002R\003va" + + "l\"B\n%Proto2ScalarRequiredIgnoreUnspecifi" + + "ed\022\031\n\003val\030\001 \002(\005B\007\272H\004\032\002 \000R\003val\"R\n0Proto2S" + + "calarRequiredIgnoreUnspecifiedWithDefaul" + + "t\022\036\n\003val\030\001 \002(\005:\003-42B\007\272H\004\032\002 \000R\003val\"?\n\037Pro" + + "to2ScalarRequiredIgnoreEmpty\022\034\n\003val\030\001 \002(" + + "\005B\n\272H\007\032\002 \000\330\001\001R\003val\"O\n*Proto2ScalarRequir" + + "edIgnoreEmptyWithDefault\022!\n\003val\030\001 \002(\005:\003-" + + "42B\n\272H\007\032\002 \000\330\001\001R\003val\"A\n!Proto2ScalarRequi" + + "redIgnoreDefault\022\034\n\003val\030\001 \002(\005B\n\272H\007\032\002 \000\330\001" + + "\002R\003val\"Q\n,Proto2ScalarRequiredIgnoreDefa" + + "ultWithDefault\022!\n\003val\030\001 \002(\005:\003-42B\n\272H\007\032\002 " + + "\000\330\001\002R\003val\"\340\001\n&Proto2MessageOptionalIgnor" + + "eUnspecified\022\234\001\n\003val\030\001 \001(\0132J.buf.validat" + + "e.conformance.cases.Proto2MessageOptiona" + + "lIgnoreUnspecified.MsgB>\272H;\272\0018\n\033proto2.m" + + "essage.ignore.empty\022\006foobar\032\021this.val ==" + + " \'foo\'R\003val\032\027\n\003Msg\022\020\n\003val\030\001 \001(\tR\003val\"\327\001\n" + + " Proto2MessageOptionalIgnoreEmpty\022\231\001\n\003va" + + "l\030\001 \001(\0132D.buf.validate.conformance.cases" + + ".Proto2MessageOptionalIgnoreEmpty.MsgBA\272" + + "H>\272\0018\n\033proto2.message.ignore.empty\022\006foob" + + "ar\032\021this.val == \'foo\'\330\001\001R\003val\032\027\n\003Msg\022\020\n\003" + + "val\030\001 \001(\tR\003val\"\333\001\n\"Proto2MessageOptional" + + "IgnoreDefault\022\233\001\n\003val\030\001 \001(\0132F.buf.valida" + + "te.conformance.cases.Proto2MessageOption" + + "alIgnoreDefault.MsgBA\272H>\272\0018\n\033proto2.mess" + + "age.ignore.empty\022\006foobar\032\021this.val == \'f" + + "oo\'\330\001\002R\003val\032\027\n\003Msg\022\020\n\003val\030\001 \001(\tR\003val\"\340\001\n" + + "&Proto2MessageRequiredIgnoreUnspecified\022" + + "\234\001\n\003val\030\001 \002(\0132J.buf.validate.conformance" + + ".cases.Proto2MessageRequiredIgnoreUnspec" + + "ified.MsgB>\272H;\272\0018\n\033proto2.message.ignore" + + ".empty\022\006foobar\032\021this.val == \'foo\'R\003val\032\027" + + "\n\003Msg\022\020\n\003val\030\001 \001(\tR\003val\"\327\001\n Proto2Messag" + + "eRequiredIgnoreEmpty\022\231\001\n\003val\030\001 \002(\0132D.buf" + + ".validate.conformance.cases.Proto2Messag" + + "eRequiredIgnoreEmpty.MsgBA\272H>\272\0018\n\033proto2" + + ".message.ignore.empty\022\006foobar\032\021this.val " + + "== \'foo\'\330\001\001R\003val\032\027\n\003Msg\022\020\n\003val\030\001 \001(\tR\003va" + + "l\"\333\001\n\"Proto2MessageRequiredIgnoreDefault" + + "\022\233\001\n\003val\030\001 \002(\0132F.buf.validate.conformanc" + + "e.cases.Proto2MessageRequiredIgnoreDefau" + + "lt.MsgBA\272H>\272\0018\n\033proto2.message.ignore.em" + + "pty\022\006foobar\032\021this.val == \'foo\'\330\001\002R\003val\032\027" + + "\n\003Msg\022\020\n\003val\030\001 \001(\tR\003val\"@\n\034Proto2OneofIg" + + "noreUnspecified\022\033\n\003val\030\001 \001(\005B\007\272H\004\032\002 \000H\000R" + + "\003valB\003\n\001o\"P\n\'Proto2OneofIgnoreUnspecifie" + + "dWithDefault\022 \n\003val\030\001 \001(\005:\003-42B\007\272H\004\032\002 \000H" + + "\000R\003valB\003\n\001o\"=\n\026Proto2OneofIgnoreEmpty\022\036\n" + + "\003val\030\001 \001(\005B\n\272H\007\032\002 \000\330\001\001H\000R\003valB\003\n\001o\"M\n!Pr" + + "oto2OneofIgnoreEmptyWithDefault\022#\n\003val\030\001" + + " \001(\005:\003-42B\n\272H\007\032\002 \000\330\001\001H\000R\003valB\003\n\001o\"?\n\030Pro" + + "to2OneofIgnoreDefault\022\036\n\003val\030\001 \001(\005B\n\272H\007\032" + + "\002 \000\330\001\002H\000R\003valB\003\n\001o\"O\n#Proto2OneofIgnoreD" + + "efaultWithDefault\022#\n\003val\030\001 \001(\005:\003-42B\n\272H\007" + + "\032\002 \000\330\001\002H\000R\003valB\003\n\001o\"=\n\037Proto2RepeatedIgn" + + "oreUnspecified\022\032\n\003val\030\001 \003(\005B\010\272H\005\222\001\002\010\003R\003v" + + "al\":\n\031Proto2RepeatedIgnoreEmpty\022\035\n\003val\030\001" + + " \003(\005B\013\272H\010\222\001\002\010\003\330\001\001R\003val\"<\n\033Proto2Repeated" + + "IgnoreDefault\022\035\n\003val\030\001 \003(\005B\013\272H\010\222\001\002\010\003\330\001\002R" + + "\003val\"\265\001\n\032Proto2MapIgnoreUnspecified\022_\n\003v" + + "al\030\001 \003(\0132C.buf.validate.conformance.case" + + "s.Proto2MapIgnoreUnspecified.ValEntryB\010\272" + + "H\005\232\001\002\010\003R\003val\0326\n\010ValEntry\022\020\n\003key\030\001 \001(\005R\003k" + + "ey\022\024\n\005value\030\002 \001(\005R\005value:\0028\001\"\254\001\n\024Proto2M" + + "apIgnoreEmpty\022\\\n\003val\030\001 \003(\0132=.buf.validat" + + "e.conformance.cases.Proto2MapIgnoreEmpty" + + ".ValEntryB\013\272H\010\232\001\002\010\003\330\001\001R\003val\0326\n\010ValEntry\022" + + "\020\n\003key\030\001 \001(\005R\003key\022\024\n\005value\030\002 \001(\005R\005value:" + + "\0028\001\"\260\001\n\026Proto2MapIgnoreDefault\022^\n\003val\030\001 " + + "\003(\0132?.buf.validate.conformance.cases.Pro" + + "to2MapIgnoreDefault.ValEntryB\013\272H\010\232\001\002\010\003\330\001" + + "\002R\003val\0326\n\010ValEntry\022\020\n\003key\030\001 \001(\005R\003key\022\024\n\005" + + "value\030\002 \001(\005R\005value:\0028\001\"E\n#Proto2Repeated" + + "ItemIgnoreUnspecified\022\036\n\003val\030\001 \003(\005B\014\272H\t\222" + + "\001\006\"\004\032\002 \000R\003val\"B\n\035Proto2RepeatedItemIgnor" + + "eEmpty\022!\n\003val\030\001 \003(\005B\017\272H\014\222\001\t\"\007\032\002 \000\330\001\001R\003va" + + "l\"D\n\037Proto2RepeatedItemIgnoreDefault\022!\n\003" + + "val\030\001 \003(\005B\017\272H\014\222\001\t\"\007\032\002 \000\330\001\002R\003val\"\277\001\n\035Prot" + + "o2MapKeyIgnoreUnspecified\022f\n\003val\030\001 \003(\0132F" + + ".buf.validate.conformance.cases.Proto2Ma" + + "pKeyIgnoreUnspecified.ValEntryB\014\272H\t\232\001\006\"\004" + + "\032\002 \000R\003val\0326\n\010ValEntry\022\020\n\003key\030\001 \001(\005R\003key\022" + + "\024\n\005value\030\002 \001(\005R\005value:\0028\001\"\266\001\n\027Proto2MapK" + + "eyIgnoreEmpty\022c\n\003val\030\001 \003(\0132@.buf.validat" + + "e.conformance.cases.Proto2MapKeyIgnoreEm" + + "pty.ValEntryB\017\272H\014\232\001\t\"\007\032\002 \000\330\001\001R\003val\0326\n\010Va" + + "lEntry\022\020\n\003key\030\001 \001(\005R\003key\022\024\n\005value\030\002 \001(\005R" + + "\005value:\0028\001\"\272\001\n\031Proto2MapKeyIgnoreDefault" + + "\022e\n\003val\030\001 \003(\0132B.buf.validate.conformance" + + ".cases.Proto2MapKeyIgnoreDefault.ValEntr" + + "yB\017\272H\014\232\001\t\"\007\032\002 \000\330\001\002R\003val\0326\n\010ValEntry\022\020\n\003k" + + "ey\030\001 \001(\005R\003key\022\024\n\005value\030\002 \001(\005R\005value:\0028\001\"" + + "\303\001\n\037Proto2MapValueIgnoreUnspecified\022h\n\003v" + + "al\030\001 \003(\0132H.buf.validate.conformance.case" + + "s.Proto2MapValueIgnoreUnspecified.ValEnt" + + "ryB\014\272H\t\232\001\006*\004\032\002 \000R\003val\0326\n\010ValEntry\022\020\n\003key" + + "\030\001 \001(\005R\003key\022\024\n\005value\030\002 \001(\005R\005value:\0028\001\"\272\001" + + "\n\031Proto2MapValueIgnoreEmpty\022e\n\003val\030\001 \003(\013" + + "2B.buf.validate.conformance.cases.Proto2" + + "MapValueIgnoreEmpty.ValEntryB\017\272H\014\232\001\t*\007\032\002" + + " \000\330\001\001R\003val\0326\n\010ValEntry\022\020\n\003key\030\001 \001(\005R\003key" + + "\022\024\n\005value\030\002 \001(\005R\005value:\0028\001\"\276\001\n\033Proto2Map" + + "ValueIgnoreDefault\022g\n\003val\030\001 \003(\0132D.buf.va" + + "lidate.conformance.cases.Proto2MapValueI" + + "gnoreDefault.ValEntryB\017\272H\014\232\001\t*\007\032\002 \000\330\001\002R\003" + + "val\0326\n\010ValEntry\022\020\n\003key\030\001 \001(\005R\003key\022\024\n\005val" + + "ue\030\002 \001(\005R\005value:\0028\001B\325\001\n$build.buf.valida" + + "te.conformance.casesB\021IgnoreProto2ProtoP" + + "\001\242\002\004BVCC\252\002\036Buf.Validate.Conformance.Case" + + "s\312\002\036Buf\\Validate\\Conformance\\Cases\342\002*Buf" + + "\\Validate\\Conformance\\Cases\\GPBMetadata\352" + + "\002!Buf::Validate::Conformance::Cases" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + build.buf.validate.ValidateProto.getDescriptor(), + }); + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecifiedWithDefault_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecifiedWithDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecifiedWithDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmptyWithDefault_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmptyWithDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmptyWithDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefaultWithDefault_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefaultWithDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefaultWithDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecifiedWithDefault_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecifiedWithDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecifiedWithDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmptyWithDefault_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmptyWithDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmptyWithDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefaultWithDefault_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefaultWithDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefaultWithDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_Msg_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_Msg_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_Msg_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_Msg_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_Msg_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_Msg_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_Msg_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_Msg_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_Msg_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_Msg_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_Msg_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_Msg_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", "O", }); + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecifiedWithDefault_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecifiedWithDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecifiedWithDefault_descriptor, + new java.lang.String[] { "Val", "O", }); + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", "O", }); + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmptyWithDefault_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmptyWithDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmptyWithDefault_descriptor, + new java.lang.String[] { "Val", "O", }); + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefault_descriptor, + new java.lang.String[] { "Val", "O", }); + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefaultWithDefault_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefaultWithDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefaultWithDefault_descriptor, + new java.lang.String[] { "Val", "O", }); + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(30); + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(31); + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(32); + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(33); + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(34); + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(35); + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(36); + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(37); + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(38); + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(build.buf.validate.ValidateProto.field); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + build.buf.validate.ValidateProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/IgnoreProto3Proto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/IgnoreProto3Proto.java new file mode 100644 index 00000000..e4cc6a05 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/IgnoreProto3Proto.java @@ -0,0 +1,647 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public final class IgnoreProto3Proto { + private IgnoreProto3Proto() {} + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistryLite registry) { + } + + public static void registerAllExtensions( + com.google.protobuf.ExtensionRegistry registry) { + registerAllExtensions( + (com.google.protobuf.ExtensionRegistryLite) registry); + } + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_ValEntry_fieldAccessorTable; + + public static com.google.protobuf.Descriptors.FileDescriptor + getDescriptor() { + return descriptor; + } + private static com.google.protobuf.Descriptors.FileDescriptor + descriptor; + static { + java.lang.String[] descriptorData = { + "\n2buf/validate/conformance/cases/ignore_" + + "proto3.proto\022\036buf.validate.conformance.c" + + "ases\032\033buf/validate/validate.proto\"O\n%Pro" + + "to3ScalarOptionalIgnoreUnspecified\022\036\n\003va" + + "l\030\001 \001(\005B\007\272H\004\032\002 \000H\000R\003val\210\001\001B\006\n\004_val\"L\n\037Pr" + + "oto3ScalarOptionalIgnoreEmpty\022!\n\003val\030\001 \001" + + "(\005B\n\272H\007\032\002 \000\330\001\001H\000R\003val\210\001\001B\006\n\004_val\"N\n!Prot" + + "o3ScalarOptionalIgnoreDefault\022!\n\003val\030\001 \001" + + "(\005B\n\272H\007\032\002 \000\330\001\002H\000R\003val\210\001\001B\006\n\004_val\":\n\035Prot" + + "o3ScalarIgnoreUnspecified\022\031\n\003val\030\001 \001(\005B\007" + + "\272H\004\032\002 \000R\003val\"7\n\027Proto3ScalarIgnoreEmpty\022" + + "\034\n\003val\030\001 \001(\005B\n\272H\007\032\002 \000\330\001\001R\003val\"9\n\031Proto3S" + + "calarIgnoreDefault\022\034\n\003val\030\001 \001(\005B\n\272H\007\032\002 \000" + + "\330\001\002R\003val\"\372\001\n&Proto3MessageOptionalIgnore" + + "Unspecified\022\241\001\n\003val\030\001 \001(\0132J.buf.validate" + + ".conformance.cases.Proto3MessageOptional" + + "IgnoreUnspecified.MsgB>\272H;\272\0018\n\033proto3.me" + + "ssage.ignore.empty\022\006foobar\032\021this.val == " + + "\'foo\'H\000R\003val\210\001\001\032$\n\003Msg\022\025\n\003val\030\001 \001(\tH\000R\003v" + + "al\210\001\001B\006\n\004_valB\006\n\004_val\"\361\001\n Proto3MessageO" + + "ptionalIgnoreEmpty\022\236\001\n\003val\030\001 \001(\0132D.buf.v" + + "alidate.conformance.cases.Proto3MessageO" + + "ptionalIgnoreEmpty.MsgBA\272H>\272\0018\n\033proto3.m" + + "essage.ignore.empty\022\006foobar\032\021this.val ==" + + " \'foo\'\330\001\001H\000R\003val\210\001\001\032$\n\003Msg\022\025\n\003val\030\001 \001(\tH" + + "\000R\003val\210\001\001B\006\n\004_valB\006\n\004_val\"\365\001\n\"Proto3Mess" + + "ageOptionalIgnoreDefault\022\240\001\n\003val\030\001 \001(\0132F" + + ".buf.validate.conformance.cases.Proto3Me" + + "ssageOptionalIgnoreDefault.MsgBA\272H>\272\0018\n\033" + + "proto3.message.ignore.empty\022\006foobar\032\021thi" + + "s.val == \'foo\'\330\001\002H\000R\003val\210\001\001\032$\n\003Msg\022\025\n\003va" + + "l\030\001 \001(\tH\000R\003val\210\001\001B\006\n\004_valB\006\n\004_val\"\335\001\n\036Pr" + + "oto3MessageIgnoreUnspecified\022\224\001\n\003val\030\001 \001" + + "(\0132B.buf.validate.conformance.cases.Prot" + + "o3MessageIgnoreUnspecified.MsgB>\272H;\272\0018\n\033" + + "proto3.message.ignore.empty\022\006foobar\032\021thi" + + "s.val == \'foo\'R\003val\032$\n\003Msg\022\025\n\003val\030\001 \001(\tH" + + "\000R\003val\210\001\001B\006\n\004_val\"\324\001\n\030Proto3MessageIgnor" + + "eEmpty\022\221\001\n\003val\030\001 \001(\0132<.buf.validate.conf" + + "ormance.cases.Proto3MessageIgnoreEmpty.M" + + "sgBA\272H>\272\0018\n\033proto3.message.ignore.empty\022" + + "\006foobar\032\021this.val == \'foo\'\330\001\001R\003val\032$\n\003Ms" + + "g\022\025\n\003val\030\001 \001(\tH\000R\003val\210\001\001B\006\n\004_val\"\330\001\n\032Pro" + + "to3MessageIgnoreDefault\022\223\001\n\003val\030\001 \001(\0132>." + + "buf.validate.conformance.cases.Proto3Mes" + + "sageIgnoreDefault.MsgBA\272H>\272\0018\n\033proto3.me" + + "ssage.ignore.empty\022\006foobar\032\021this.val == " + + "\'foo\'\330\001\002R\003val\032$\n\003Msg\022\025\n\003val\030\001 \001(\tH\000R\003val" + + "\210\001\001B\006\n\004_val\"@\n\034Proto3OneofIgnoreUnspecif" + + "ied\022\033\n\003val\030\001 \001(\005B\007\272H\004\032\002 \000H\000R\003valB\003\n\001o\"=\n" + + "\026Proto3OneofIgnoreEmpty\022\036\n\003val\030\001 \001(\005B\n\272H" + + "\007\032\002 \000\330\001\001H\000R\003valB\003\n\001o\"?\n\030Proto3OneofIgnor" + + "eDefault\022\036\n\003val\030\001 \001(\005B\n\272H\007\032\002 \000\330\001\002H\000R\003val" + + "B\003\n\001o\"=\n\037Proto3RepeatedIgnoreUnspecified" + + "\022\032\n\003val\030\001 \003(\005B\010\272H\005\222\001\002\010\003R\003val\":\n\031Proto3Re" + + "peatedIgnoreEmpty\022\035\n\003val\030\001 \003(\005B\013\272H\010\222\001\002\010\003" + + "\330\001\001R\003val\"<\n\033Proto3RepeatedIgnoreDefault\022" + + "\035\n\003val\030\001 \003(\005B\013\272H\010\222\001\002\010\003\330\001\002R\003val\"\265\001\n\032Proto" + + "3MapIgnoreUnspecified\022_\n\003val\030\001 \003(\0132C.buf" + + ".validate.conformance.cases.Proto3MapIgn" + + "oreUnspecified.ValEntryB\010\272H\005\232\001\002\010\003R\003val\0326" + + "\n\010ValEntry\022\020\n\003key\030\001 \001(\005R\003key\022\024\n\005value\030\002 " + + "\001(\005R\005value:\0028\001\"\254\001\n\024Proto3MapIgnoreEmpty\022" + + "\\\n\003val\030\001 \003(\0132=.buf.validate.conformance." + + "cases.Proto3MapIgnoreEmpty.ValEntryB\013\272H\010" + + "\232\001\002\010\003\330\001\001R\003val\0326\n\010ValEntry\022\020\n\003key\030\001 \001(\005R\003" + + "key\022\024\n\005value\030\002 \001(\005R\005value:\0028\001\"\260\001\n\026Proto3" + + "MapIgnoreDefault\022^\n\003val\030\001 \003(\0132?.buf.vali" + + "date.conformance.cases.Proto3MapIgnoreDe" + + "fault.ValEntryB\013\272H\010\232\001\002\010\003\330\001\002R\003val\0326\n\010ValE" + + "ntry\022\020\n\003key\030\001 \001(\005R\003key\022\024\n\005value\030\002 \001(\005R\005v" + + "alue:\0028\001\"E\n#Proto3RepeatedItemIgnoreUnsp" + + "ecified\022\036\n\003val\030\001 \003(\005B\014\272H\t\222\001\006\"\004\032\002 \000R\003val\"" + + "B\n\035Proto3RepeatedItemIgnoreEmpty\022!\n\003val\030" + + "\001 \003(\005B\017\272H\014\222\001\t\"\007\032\002 \000\330\001\001R\003val\"D\n\037Proto3Rep" + + "eatedItemIgnoreDefault\022!\n\003val\030\001 \003(\005B\017\272H\014" + + "\222\001\t\"\007\032\002 \000\330\001\002R\003val\"\277\001\n\035Proto3MapKeyIgnore" + + "Unspecified\022f\n\003val\030\001 \003(\0132F.buf.validate." + + "conformance.cases.Proto3MapKeyIgnoreUnsp" + + "ecified.ValEntryB\014\272H\t\232\001\006\"\004\032\002 \000R\003val\0326\n\010V" + + "alEntry\022\020\n\003key\030\001 \001(\005R\003key\022\024\n\005value\030\002 \001(\005" + + "R\005value:\0028\001\"\266\001\n\027Proto3MapKeyIgnoreEmpty\022" + + "c\n\003val\030\001 \003(\0132@.buf.validate.conformance." + + "cases.Proto3MapKeyIgnoreEmpty.ValEntryB\017" + + "\272H\014\232\001\t\"\007\032\002 \000\330\001\001R\003val\0326\n\010ValEntry\022\020\n\003key\030" + + "\001 \001(\005R\003key\022\024\n\005value\030\002 \001(\005R\005value:\0028\001\"\272\001\n" + + "\031Proto3MapKeyIgnoreDefault\022e\n\003val\030\001 \003(\0132" + + "B.buf.validate.conformance.cases.Proto3M" + + "apKeyIgnoreDefault.ValEntryB\017\272H\014\232\001\t\"\007\032\002 " + + "\000\330\001\002R\003val\0326\n\010ValEntry\022\020\n\003key\030\001 \001(\005R\003key\022" + + "\024\n\005value\030\002 \001(\005R\005value:\0028\001\"\303\001\n\037Proto3MapV" + + "alueIgnoreUnspecified\022h\n\003val\030\001 \003(\0132H.buf" + + ".validate.conformance.cases.Proto3MapVal" + + "ueIgnoreUnspecified.ValEntryB\014\272H\t\232\001\006*\004\032\002" + + " \000R\003val\0326\n\010ValEntry\022\020\n\003key\030\001 \001(\005R\003key\022\024\n" + + "\005value\030\002 \001(\005R\005value:\0028\001\"\272\001\n\031Proto3MapVal" + + "ueIgnoreEmpty\022e\n\003val\030\001 \003(\0132B.buf.validat" + + "e.conformance.cases.Proto3MapValueIgnore" + + "Empty.ValEntryB\017\272H\014\232\001\t*\007\032\002 \000\330\001\001R\003val\0326\n\010" + + "ValEntry\022\020\n\003key\030\001 \001(\005R\003key\022\024\n\005value\030\002 \001(" + + "\005R\005value:\0028\001\"\276\001\n\033Proto3MapValueIgnoreDef" + + "ault\022g\n\003val\030\001 \003(\0132D.buf.validate.conform" + + "ance.cases.Proto3MapValueIgnoreDefault.V" + + "alEntryB\017\272H\014\232\001\t*\007\032\002 \000\330\001\002R\003val\0326\n\010ValEntr" + + "y\022\020\n\003key\030\001 \001(\005R\003key\022\024\n\005value\030\002 \001(\005R\005valu" + + "e:\0028\001B\325\001\n$build.buf.validate.conformance" + + ".casesB\021IgnoreProto3ProtoP\001\242\002\004BVCC\252\002\036Buf" + + ".Validate.Conformance.Cases\312\002\036Buf\\Valida" + + "te\\Conformance\\Cases\342\002*Buf\\Validate\\Conf" + + "ormance\\Cases\\GPBMetadata\352\002!Buf::Validat" + + "e::Conformance::Casesb\006proto3" + }; + descriptor = com.google.protobuf.Descriptors.FileDescriptor + .internalBuildGeneratedFileFrom(descriptorData, + new com.google.protobuf.Descriptors.FileDescriptor[] { + build.buf.validate.ValidateProto.getDescriptor(), + }); + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", "Val", }); + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(1); + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", "Val", }); + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(2); + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreDefault_descriptor, + new java.lang.String[] { "Val", "Val", }); + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(4); + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_Msg_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_Msg_descriptor, + new java.lang.String[] { "Val", "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_Msg_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_Msg_descriptor, + new java.lang.String[] { "Val", "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_descriptor, + new java.lang.String[] { "Val", "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_Msg_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_Msg_descriptor, + new java.lang.String[] { "Val", "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_Msg_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_Msg_descriptor, + new java.lang.String[] { "Val", "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_Msg_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_Msg_descriptor, + new java.lang.String[] { "Val", "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_Msg_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_Msg_descriptor, + new java.lang.String[] { "Val", "Val", }); + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", "O", }); + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(13); + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", "O", }); + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(14); + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreDefault_descriptor, + new java.lang.String[] { "Val", "O", }); + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(15); + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(16); + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(17); + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(18); + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(19); + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(20); + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(21); + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(22); + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(23); + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(24); + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(25); + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(26); + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_descriptor = + getDescriptor().getMessageTypes().get(27); + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_descriptor = + getDescriptor().getMessageTypes().get(28); + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_descriptor = + getDescriptor().getMessageTypes().get(29); + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); + com.google.protobuf.ExtensionRegistry registry = + com.google.protobuf.ExtensionRegistry.newInstance(); + registry.add(build.buf.validate.ValidateProto.field); + com.google.protobuf.Descriptors.FileDescriptor + .internalUpdateFileDescriptor(descriptor, registry); + build.buf.validate.ValidateProto.getDescriptor(); + } + + // @@protoc_insertion_point(outer_class_scope) +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Int64BigConstraints.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Int64BigConstraints.java new file mode 100644 index 00000000..cafbdccb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Int64BigConstraints.java @@ -0,0 +1,1225 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/numbers.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Int64BigConstraints} + */ +public final class Int64BigConstraints extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Int64BigConstraints) + Int64BigConstraintsOrBuilder { +private static final long serialVersionUID = 0L; + // Use Int64BigConstraints.newBuilder() to construct. + private Int64BigConstraints(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Int64BigConstraints() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Int64BigConstraints(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int64BigConstraints_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int64BigConstraints_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Int64BigConstraints.class, build.buf.validate.conformance.cases.Int64BigConstraints.Builder.class); + } + + public static final int LT_POS_FIELD_NUMBER = 1; + private long ltPos_ = 0L; + /** + *
+   * Intentionally choose limits that are outside the range of both signed and unsigned 32-bit integers.
+   * 
+ * + * int64 lt_pos = 1 [json_name = "ltPos", (.buf.validate.field) = { ... } + * @return The ltPos. + */ + @java.lang.Override + public long getLtPos() { + return ltPos_; + } + + public static final int LT_NEG_FIELD_NUMBER = 2; + private long ltNeg_ = 0L; + /** + * int64 lt_neg = 2 [json_name = "ltNeg", (.buf.validate.field) = { ... } + * @return The ltNeg. + */ + @java.lang.Override + public long getLtNeg() { + return ltNeg_; + } + + public static final int GT_POS_FIELD_NUMBER = 3; + private long gtPos_ = 0L; + /** + * int64 gt_pos = 3 [json_name = "gtPos", (.buf.validate.field) = { ... } + * @return The gtPos. + */ + @java.lang.Override + public long getGtPos() { + return gtPos_; + } + + public static final int GT_NEG_FIELD_NUMBER = 4; + private long gtNeg_ = 0L; + /** + * int64 gt_neg = 4 [json_name = "gtNeg", (.buf.validate.field) = { ... } + * @return The gtNeg. + */ + @java.lang.Override + public long getGtNeg() { + return gtNeg_; + } + + public static final int LTE_POS_FIELD_NUMBER = 5; + private long ltePos_ = 0L; + /** + * int64 lte_pos = 5 [json_name = "ltePos", (.buf.validate.field) = { ... } + * @return The ltePos. + */ + @java.lang.Override + public long getLtePos() { + return ltePos_; + } + + public static final int LTE_NEG_FIELD_NUMBER = 6; + private long lteNeg_ = 0L; + /** + * int64 lte_neg = 6 [json_name = "lteNeg", (.buf.validate.field) = { ... } + * @return The lteNeg. + */ + @java.lang.Override + public long getLteNeg() { + return lteNeg_; + } + + public static final int GTE_POS_FIELD_NUMBER = 7; + private long gtePos_ = 0L; + /** + * int64 gte_pos = 7 [json_name = "gtePos", (.buf.validate.field) = { ... } + * @return The gtePos. + */ + @java.lang.Override + public long getGtePos() { + return gtePos_; + } + + public static final int GTE_NEG_FIELD_NUMBER = 8; + private long gteNeg_ = 0L; + /** + * int64 gte_neg = 8 [json_name = "gteNeg", (.buf.validate.field) = { ... } + * @return The gteNeg. + */ + @java.lang.Override + public long getGteNeg() { + return gteNeg_; + } + + public static final int CONSTANT_POS_FIELD_NUMBER = 9; + private long constantPos_ = 0L; + /** + * int64 constant_pos = 9 [json_name = "constantPos", (.buf.validate.field) = { ... } + * @return The constantPos. + */ + @java.lang.Override + public long getConstantPos() { + return constantPos_; + } + + public static final int CONSTANT_NEG_FIELD_NUMBER = 10; + private long constantNeg_ = 0L; + /** + * int64 constant_neg = 10 [json_name = "constantNeg", (.buf.validate.field) = { ... } + * @return The constantNeg. + */ + @java.lang.Override + public long getConstantNeg() { + return constantNeg_; + } + + public static final int IN_FIELD_NUMBER = 11; + private long in_ = 0L; + /** + * int64 in = 11 [json_name = "in", (.buf.validate.field) = { ... } + * @return The in. + */ + @java.lang.Override + public long getIn() { + return in_; + } + + public static final int NOTIN_FIELD_NUMBER = 12; + private long notin_ = 0L; + /** + * int64 notin = 12 [json_name = "notin", (.buf.validate.field) = { ... } + * @return The notin. + */ + @java.lang.Override + public long getNotin() { + return notin_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (ltPos_ != 0L) { + output.writeInt64(1, ltPos_); + } + if (ltNeg_ != 0L) { + output.writeInt64(2, ltNeg_); + } + if (gtPos_ != 0L) { + output.writeInt64(3, gtPos_); + } + if (gtNeg_ != 0L) { + output.writeInt64(4, gtNeg_); + } + if (ltePos_ != 0L) { + output.writeInt64(5, ltePos_); + } + if (lteNeg_ != 0L) { + output.writeInt64(6, lteNeg_); + } + if (gtePos_ != 0L) { + output.writeInt64(7, gtePos_); + } + if (gteNeg_ != 0L) { + output.writeInt64(8, gteNeg_); + } + if (constantPos_ != 0L) { + output.writeInt64(9, constantPos_); + } + if (constantNeg_ != 0L) { + output.writeInt64(10, constantNeg_); + } + if (in_ != 0L) { + output.writeInt64(11, in_); + } + if (notin_ != 0L) { + output.writeInt64(12, notin_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (ltPos_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(1, ltPos_); + } + if (ltNeg_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(2, ltNeg_); + } + if (gtPos_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(3, gtPos_); + } + if (gtNeg_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(4, gtNeg_); + } + if (ltePos_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(5, ltePos_); + } + if (lteNeg_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(6, lteNeg_); + } + if (gtePos_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(7, gtePos_); + } + if (gteNeg_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(8, gteNeg_); + } + if (constantPos_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(9, constantPos_); + } + if (constantNeg_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(10, constantNeg_); + } + if (in_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(11, in_); + } + if (notin_ != 0L) { + size += com.google.protobuf.CodedOutputStream + .computeInt64Size(12, notin_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Int64BigConstraints)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Int64BigConstraints other = (build.buf.validate.conformance.cases.Int64BigConstraints) obj; + + if (getLtPos() + != other.getLtPos()) return false; + if (getLtNeg() + != other.getLtNeg()) return false; + if (getGtPos() + != other.getGtPos()) return false; + if (getGtNeg() + != other.getGtNeg()) return false; + if (getLtePos() + != other.getLtePos()) return false; + if (getLteNeg() + != other.getLteNeg()) return false; + if (getGtePos() + != other.getGtePos()) return false; + if (getGteNeg() + != other.getGteNeg()) return false; + if (getConstantPos() + != other.getConstantPos()) return false; + if (getConstantNeg() + != other.getConstantNeg()) return false; + if (getIn() + != other.getIn()) return false; + if (getNotin() + != other.getNotin()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + LT_POS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLtPos()); + hash = (37 * hash) + LT_NEG_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLtNeg()); + hash = (37 * hash) + GT_POS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getGtPos()); + hash = (37 * hash) + GT_NEG_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getGtNeg()); + hash = (37 * hash) + LTE_POS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLtePos()); + hash = (37 * hash) + LTE_NEG_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getLteNeg()); + hash = (37 * hash) + GTE_POS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getGtePos()); + hash = (37 * hash) + GTE_NEG_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getGteNeg()); + hash = (37 * hash) + CONSTANT_POS_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getConstantPos()); + hash = (37 * hash) + CONSTANT_NEG_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getConstantNeg()); + hash = (37 * hash) + IN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getIn()); + hash = (37 * hash) + NOTIN_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashLong( + getNotin()); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Int64BigConstraints parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Int64BigConstraints parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Int64BigConstraints parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Int64BigConstraints parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Int64BigConstraints parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Int64BigConstraints parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Int64BigConstraints parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Int64BigConstraints parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Int64BigConstraints parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Int64BigConstraints parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Int64BigConstraints parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Int64BigConstraints parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Int64BigConstraints prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Int64BigConstraints} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Int64BigConstraints) + build.buf.validate.conformance.cases.Int64BigConstraintsOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int64BigConstraints_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int64BigConstraints_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Int64BigConstraints.class, build.buf.validate.conformance.cases.Int64BigConstraints.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Int64BigConstraints.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + ltPos_ = 0L; + ltNeg_ = 0L; + gtPos_ = 0L; + gtNeg_ = 0L; + ltePos_ = 0L; + lteNeg_ = 0L; + gtePos_ = 0L; + gteNeg_ = 0L; + constantPos_ = 0L; + constantNeg_ = 0L; + in_ = 0L; + notin_ = 0L; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.NumbersProto.internal_static_buf_validate_conformance_cases_Int64BigConstraints_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Int64BigConstraints getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Int64BigConstraints.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Int64BigConstraints build() { + build.buf.validate.conformance.cases.Int64BigConstraints result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Int64BigConstraints buildPartial() { + build.buf.validate.conformance.cases.Int64BigConstraints result = new build.buf.validate.conformance.cases.Int64BigConstraints(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Int64BigConstraints result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.ltPos_ = ltPos_; + } + if (((from_bitField0_ & 0x00000002) != 0)) { + result.ltNeg_ = ltNeg_; + } + if (((from_bitField0_ & 0x00000004) != 0)) { + result.gtPos_ = gtPos_; + } + if (((from_bitField0_ & 0x00000008) != 0)) { + result.gtNeg_ = gtNeg_; + } + if (((from_bitField0_ & 0x00000010) != 0)) { + result.ltePos_ = ltePos_; + } + if (((from_bitField0_ & 0x00000020) != 0)) { + result.lteNeg_ = lteNeg_; + } + if (((from_bitField0_ & 0x00000040) != 0)) { + result.gtePos_ = gtePos_; + } + if (((from_bitField0_ & 0x00000080) != 0)) { + result.gteNeg_ = gteNeg_; + } + if (((from_bitField0_ & 0x00000100) != 0)) { + result.constantPos_ = constantPos_; + } + if (((from_bitField0_ & 0x00000200) != 0)) { + result.constantNeg_ = constantNeg_; + } + if (((from_bitField0_ & 0x00000400) != 0)) { + result.in_ = in_; + } + if (((from_bitField0_ & 0x00000800) != 0)) { + result.notin_ = notin_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Int64BigConstraints) { + return mergeFrom((build.buf.validate.conformance.cases.Int64BigConstraints)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Int64BigConstraints other) { + if (other == build.buf.validate.conformance.cases.Int64BigConstraints.getDefaultInstance()) return this; + if (other.getLtPos() != 0L) { + setLtPos(other.getLtPos()); + } + if (other.getLtNeg() != 0L) { + setLtNeg(other.getLtNeg()); + } + if (other.getGtPos() != 0L) { + setGtPos(other.getGtPos()); + } + if (other.getGtNeg() != 0L) { + setGtNeg(other.getGtNeg()); + } + if (other.getLtePos() != 0L) { + setLtePos(other.getLtePos()); + } + if (other.getLteNeg() != 0L) { + setLteNeg(other.getLteNeg()); + } + if (other.getGtePos() != 0L) { + setGtePos(other.getGtePos()); + } + if (other.getGteNeg() != 0L) { + setGteNeg(other.getGteNeg()); + } + if (other.getConstantPos() != 0L) { + setConstantPos(other.getConstantPos()); + } + if (other.getConstantNeg() != 0L) { + setConstantNeg(other.getConstantNeg()); + } + if (other.getIn() != 0L) { + setIn(other.getIn()); + } + if (other.getNotin() != 0L) { + setNotin(other.getNotin()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + ltPos_ = input.readInt64(); + bitField0_ |= 0x00000001; + break; + } // case 8 + case 16: { + ltNeg_ = input.readInt64(); + bitField0_ |= 0x00000002; + break; + } // case 16 + case 24: { + gtPos_ = input.readInt64(); + bitField0_ |= 0x00000004; + break; + } // case 24 + case 32: { + gtNeg_ = input.readInt64(); + bitField0_ |= 0x00000008; + break; + } // case 32 + case 40: { + ltePos_ = input.readInt64(); + bitField0_ |= 0x00000010; + break; + } // case 40 + case 48: { + lteNeg_ = input.readInt64(); + bitField0_ |= 0x00000020; + break; + } // case 48 + case 56: { + gtePos_ = input.readInt64(); + bitField0_ |= 0x00000040; + break; + } // case 56 + case 64: { + gteNeg_ = input.readInt64(); + bitField0_ |= 0x00000080; + break; + } // case 64 + case 72: { + constantPos_ = input.readInt64(); + bitField0_ |= 0x00000100; + break; + } // case 72 + case 80: { + constantNeg_ = input.readInt64(); + bitField0_ |= 0x00000200; + break; + } // case 80 + case 88: { + in_ = input.readInt64(); + bitField0_ |= 0x00000400; + break; + } // case 88 + case 96: { + notin_ = input.readInt64(); + bitField0_ |= 0x00000800; + break; + } // case 96 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private long ltPos_ ; + /** + *
+     * Intentionally choose limits that are outside the range of both signed and unsigned 32-bit integers.
+     * 
+ * + * int64 lt_pos = 1 [json_name = "ltPos", (.buf.validate.field) = { ... } + * @return The ltPos. + */ + @java.lang.Override + public long getLtPos() { + return ltPos_; + } + /** + *
+     * Intentionally choose limits that are outside the range of both signed and unsigned 32-bit integers.
+     * 
+ * + * int64 lt_pos = 1 [json_name = "ltPos", (.buf.validate.field) = { ... } + * @param value The ltPos to set. + * @return This builder for chaining. + */ + public Builder setLtPos(long value) { + + ltPos_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + *
+     * Intentionally choose limits that are outside the range of both signed and unsigned 32-bit integers.
+     * 
+ * + * int64 lt_pos = 1 [json_name = "ltPos", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearLtPos() { + bitField0_ = (bitField0_ & ~0x00000001); + ltPos_ = 0L; + onChanged(); + return this; + } + + private long ltNeg_ ; + /** + * int64 lt_neg = 2 [json_name = "ltNeg", (.buf.validate.field) = { ... } + * @return The ltNeg. + */ + @java.lang.Override + public long getLtNeg() { + return ltNeg_; + } + /** + * int64 lt_neg = 2 [json_name = "ltNeg", (.buf.validate.field) = { ... } + * @param value The ltNeg to set. + * @return This builder for chaining. + */ + public Builder setLtNeg(long value) { + + ltNeg_ = value; + bitField0_ |= 0x00000002; + onChanged(); + return this; + } + /** + * int64 lt_neg = 2 [json_name = "ltNeg", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearLtNeg() { + bitField0_ = (bitField0_ & ~0x00000002); + ltNeg_ = 0L; + onChanged(); + return this; + } + + private long gtPos_ ; + /** + * int64 gt_pos = 3 [json_name = "gtPos", (.buf.validate.field) = { ... } + * @return The gtPos. + */ + @java.lang.Override + public long getGtPos() { + return gtPos_; + } + /** + * int64 gt_pos = 3 [json_name = "gtPos", (.buf.validate.field) = { ... } + * @param value The gtPos to set. + * @return This builder for chaining. + */ + public Builder setGtPos(long value) { + + gtPos_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + * int64 gt_pos = 3 [json_name = "gtPos", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearGtPos() { + bitField0_ = (bitField0_ & ~0x00000004); + gtPos_ = 0L; + onChanged(); + return this; + } + + private long gtNeg_ ; + /** + * int64 gt_neg = 4 [json_name = "gtNeg", (.buf.validate.field) = { ... } + * @return The gtNeg. + */ + @java.lang.Override + public long getGtNeg() { + return gtNeg_; + } + /** + * int64 gt_neg = 4 [json_name = "gtNeg", (.buf.validate.field) = { ... } + * @param value The gtNeg to set. + * @return This builder for chaining. + */ + public Builder setGtNeg(long value) { + + gtNeg_ = value; + bitField0_ |= 0x00000008; + onChanged(); + return this; + } + /** + * int64 gt_neg = 4 [json_name = "gtNeg", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearGtNeg() { + bitField0_ = (bitField0_ & ~0x00000008); + gtNeg_ = 0L; + onChanged(); + return this; + } + + private long ltePos_ ; + /** + * int64 lte_pos = 5 [json_name = "ltePos", (.buf.validate.field) = { ... } + * @return The ltePos. + */ + @java.lang.Override + public long getLtePos() { + return ltePos_; + } + /** + * int64 lte_pos = 5 [json_name = "ltePos", (.buf.validate.field) = { ... } + * @param value The ltePos to set. + * @return This builder for chaining. + */ + public Builder setLtePos(long value) { + + ltePos_ = value; + bitField0_ |= 0x00000010; + onChanged(); + return this; + } + /** + * int64 lte_pos = 5 [json_name = "ltePos", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearLtePos() { + bitField0_ = (bitField0_ & ~0x00000010); + ltePos_ = 0L; + onChanged(); + return this; + } + + private long lteNeg_ ; + /** + * int64 lte_neg = 6 [json_name = "lteNeg", (.buf.validate.field) = { ... } + * @return The lteNeg. + */ + @java.lang.Override + public long getLteNeg() { + return lteNeg_; + } + /** + * int64 lte_neg = 6 [json_name = "lteNeg", (.buf.validate.field) = { ... } + * @param value The lteNeg to set. + * @return This builder for chaining. + */ + public Builder setLteNeg(long value) { + + lteNeg_ = value; + bitField0_ |= 0x00000020; + onChanged(); + return this; + } + /** + * int64 lte_neg = 6 [json_name = "lteNeg", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearLteNeg() { + bitField0_ = (bitField0_ & ~0x00000020); + lteNeg_ = 0L; + onChanged(); + return this; + } + + private long gtePos_ ; + /** + * int64 gte_pos = 7 [json_name = "gtePos", (.buf.validate.field) = { ... } + * @return The gtePos. + */ + @java.lang.Override + public long getGtePos() { + return gtePos_; + } + /** + * int64 gte_pos = 7 [json_name = "gtePos", (.buf.validate.field) = { ... } + * @param value The gtePos to set. + * @return This builder for chaining. + */ + public Builder setGtePos(long value) { + + gtePos_ = value; + bitField0_ |= 0x00000040; + onChanged(); + return this; + } + /** + * int64 gte_pos = 7 [json_name = "gtePos", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearGtePos() { + bitField0_ = (bitField0_ & ~0x00000040); + gtePos_ = 0L; + onChanged(); + return this; + } + + private long gteNeg_ ; + /** + * int64 gte_neg = 8 [json_name = "gteNeg", (.buf.validate.field) = { ... } + * @return The gteNeg. + */ + @java.lang.Override + public long getGteNeg() { + return gteNeg_; + } + /** + * int64 gte_neg = 8 [json_name = "gteNeg", (.buf.validate.field) = { ... } + * @param value The gteNeg to set. + * @return This builder for chaining. + */ + public Builder setGteNeg(long value) { + + gteNeg_ = value; + bitField0_ |= 0x00000080; + onChanged(); + return this; + } + /** + * int64 gte_neg = 8 [json_name = "gteNeg", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearGteNeg() { + bitField0_ = (bitField0_ & ~0x00000080); + gteNeg_ = 0L; + onChanged(); + return this; + } + + private long constantPos_ ; + /** + * int64 constant_pos = 9 [json_name = "constantPos", (.buf.validate.field) = { ... } + * @return The constantPos. + */ + @java.lang.Override + public long getConstantPos() { + return constantPos_; + } + /** + * int64 constant_pos = 9 [json_name = "constantPos", (.buf.validate.field) = { ... } + * @param value The constantPos to set. + * @return This builder for chaining. + */ + public Builder setConstantPos(long value) { + + constantPos_ = value; + bitField0_ |= 0x00000100; + onChanged(); + return this; + } + /** + * int64 constant_pos = 9 [json_name = "constantPos", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearConstantPos() { + bitField0_ = (bitField0_ & ~0x00000100); + constantPos_ = 0L; + onChanged(); + return this; + } + + private long constantNeg_ ; + /** + * int64 constant_neg = 10 [json_name = "constantNeg", (.buf.validate.field) = { ... } + * @return The constantNeg. + */ + @java.lang.Override + public long getConstantNeg() { + return constantNeg_; + } + /** + * int64 constant_neg = 10 [json_name = "constantNeg", (.buf.validate.field) = { ... } + * @param value The constantNeg to set. + * @return This builder for chaining. + */ + public Builder setConstantNeg(long value) { + + constantNeg_ = value; + bitField0_ |= 0x00000200; + onChanged(); + return this; + } + /** + * int64 constant_neg = 10 [json_name = "constantNeg", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearConstantNeg() { + bitField0_ = (bitField0_ & ~0x00000200); + constantNeg_ = 0L; + onChanged(); + return this; + } + + private long in_ ; + /** + * int64 in = 11 [json_name = "in", (.buf.validate.field) = { ... } + * @return The in. + */ + @java.lang.Override + public long getIn() { + return in_; + } + /** + * int64 in = 11 [json_name = "in", (.buf.validate.field) = { ... } + * @param value The in to set. + * @return This builder for chaining. + */ + public Builder setIn(long value) { + + in_ = value; + bitField0_ |= 0x00000400; + onChanged(); + return this; + } + /** + * int64 in = 11 [json_name = "in", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearIn() { + bitField0_ = (bitField0_ & ~0x00000400); + in_ = 0L; + onChanged(); + return this; + } + + private long notin_ ; + /** + * int64 notin = 12 [json_name = "notin", (.buf.validate.field) = { ... } + * @return The notin. + */ + @java.lang.Override + public long getNotin() { + return notin_; + } + /** + * int64 notin = 12 [json_name = "notin", (.buf.validate.field) = { ... } + * @param value The notin to set. + * @return This builder for chaining. + */ + public Builder setNotin(long value) { + + notin_ = value; + bitField0_ |= 0x00000800; + onChanged(); + return this; + } + /** + * int64 notin = 12 [json_name = "notin", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearNotin() { + bitField0_ = (bitField0_ & ~0x00000800); + notin_ = 0L; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Int64BigConstraints) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Int64BigConstraints) + private static final build.buf.validate.conformance.cases.Int64BigConstraints DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Int64BigConstraints(); + } + + public static build.buf.validate.conformance.cases.Int64BigConstraints getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Int64BigConstraints parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Int64BigConstraints getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Int64BigConstraintsOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Int64BigConstraintsOrBuilder.java new file mode 100644 index 00000000..8ee6b358 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Int64BigConstraintsOrBuilder.java @@ -0,0 +1,85 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/numbers.proto + +package build.buf.validate.conformance.cases; + +public interface Int64BigConstraintsOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Int64BigConstraints) + com.google.protobuf.MessageOrBuilder { + + /** + *
+   * Intentionally choose limits that are outside the range of both signed and unsigned 32-bit integers.
+   * 
+ * + * int64 lt_pos = 1 [json_name = "ltPos", (.buf.validate.field) = { ... } + * @return The ltPos. + */ + long getLtPos(); + + /** + * int64 lt_neg = 2 [json_name = "ltNeg", (.buf.validate.field) = { ... } + * @return The ltNeg. + */ + long getLtNeg(); + + /** + * int64 gt_pos = 3 [json_name = "gtPos", (.buf.validate.field) = { ... } + * @return The gtPos. + */ + long getGtPos(); + + /** + * int64 gt_neg = 4 [json_name = "gtNeg", (.buf.validate.field) = { ... } + * @return The gtNeg. + */ + long getGtNeg(); + + /** + * int64 lte_pos = 5 [json_name = "ltePos", (.buf.validate.field) = { ... } + * @return The ltePos. + */ + long getLtePos(); + + /** + * int64 lte_neg = 6 [json_name = "lteNeg", (.buf.validate.field) = { ... } + * @return The lteNeg. + */ + long getLteNeg(); + + /** + * int64 gte_pos = 7 [json_name = "gtePos", (.buf.validate.field) = { ... } + * @return The gtePos. + */ + long getGtePos(); + + /** + * int64 gte_neg = 8 [json_name = "gteNeg", (.buf.validate.field) = { ... } + * @return The gteNeg. + */ + long getGteNeg(); + + /** + * int64 constant_pos = 9 [json_name = "constantPos", (.buf.validate.field) = { ... } + * @return The constantPos. + */ + long getConstantPos(); + + /** + * int64 constant_neg = 10 [json_name = "constantNeg", (.buf.validate.field) = { ... } + * @return The constantNeg. + */ + long getConstantNeg(); + + /** + * int64 in = 11 [json_name = "in", (.buf.validate.field) = { ... } + * @return The in. + */ + long getIn(); + + /** + * int64 notin = 12 [json_name = "notin", (.buf.validate.field) = { ... } + * @return The notin. + */ + long getNotin(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/MessagesProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/MessagesProto.java index 89b8e086..3a674773 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/MessagesProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/MessagesProto.java @@ -94,7 +94,7 @@ public static void registerAllExtensions( "E\n\003val\030\001 \001(\01323.buf.validate.conformance." + "cases.other_package.EmbedR\003val\"P\n\013Messag" + "eSkip\022A\n\003val\030\001 \001(\0132\'.buf.validate.confor" + - "mance.cases.TestMsgB\006\272H\003\300\001\001R\003val\"T\n\017Mess" + + "mance.cases.TestMsgB\006\272H\003\330\001\003R\003val\"T\n\017Mess" + "ageRequired\022A\n\003val\030\001 \001(\0132\'.buf.validate." + "conformance.cases.TestMsgB\006\272H\003\310\001\001R\003val\"l" + "\n\032MessageRequiredButOptional\022F\n\003val\030\001 \001(" + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/NumbersProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/NumbersProto.java index 7d6a29b3..792e7cae 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/NumbersProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/NumbersProto.java @@ -299,6 +299,11 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_buf_validate_conformance_cases_Int64Ignore_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_Int64BigConstraints_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_Int64BigConstraints_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_Int64IncorrectType_descriptor; static final @@ -945,146 +950,159 @@ public static void registerAllExtensions( "l\030\001 \001(\003B\013\272H\010\"\006\030\200\002(\200\001R\003val\".\n\rInt64ExGTEL" + "TE\022\035\n\003val\030\001 \001(\003B\013\272H\010\"\006\030\200\001(\200\002R\003val\"/\n\013Int" + "64Ignore\022 \n\003val\030\001 \001(\003B\016\272H\013\"\006\030\200\002(\200\001\320\001\001R\003v" + - "al\"2\n\022Int64IncorrectType\022\034\n\003val\030\001 \001(\003B\n\272" + - "H\007\n\005%\000\000\000\000R\003val\"\036\n\nUInt32None\022\020\n\003val\030\001 \001(" + - "\rR\003val\"(\n\013UInt32Const\022\031\n\003val\030\001 \001(\rB\007\272H\004*" + - "\002\010\001R\003val\"\'\n\010UInt32In\022\033\n\003val\030\001 \001(\rB\t\272H\006*\004" + - "2\002\002\003R\003val\")\n\013UInt32NotIn\022\032\n\003val\030\001 \001(\rB\010\272" + - "H\005*\003:\001\000R\003val\"%\n\010UInt32LT\022\031\n\003val\030\001 \001(\rB\007\272" + - "H\004*\002\020\005R\003val\"&\n\tUInt32LTE\022\031\n\003val\030\001 \001(\rB\007\272" + - "H\004*\002\030@R\003val\"%\n\010UInt32GT\022\031\n\003val\030\001 \001(\rB\007\272H" + - "\004*\002 \020R\003val\"&\n\tUInt32GTE\022\031\n\003val\030\001 \001(\rB\007\272H" + - "\004*\002(\010R\003val\")\n\nUInt32GTLT\022\033\n\003val\030\001 \001(\rB\t\272" + - "H\006*\004\020\n \005R\003val\"+\n\014UInt32ExLTGT\022\033\n\003val\030\001 \001" + - "(\rB\t\272H\006*\004\020\005 \nR\003val\"-\n\014UInt32GTELTE\022\035\n\003va" + - "l\030\001 \001(\rB\013\272H\010*\006\030\200\002(\200\001R\003val\"/\n\016UInt32ExGTE" + - "LTE\022\035\n\003val\030\001 \001(\rB\013\272H\010*\006\030\200\001(\200\002R\003val\"0\n\014UI" + - "nt32Ignore\022 \n\003val\030\001 \001(\rB\016\272H\013*\006\030\200\002(\200\001\320\001\001R" + - "\003val\"3\n\023UInt32IncorrectType\022\034\n\003val\030\001 \001(\r" + - "B\n\272H\007\n\005%\000\000\000\000R\003val\"\036\n\nUInt64None\022\020\n\003val\030\001" + - " \001(\004R\003val\"(\n\013UInt64Const\022\031\n\003val\030\001 \001(\004B\007\272" + - "H\0042\002\010\001R\003val\"\'\n\010UInt64In\022\033\n\003val\030\001 \001(\004B\t\272H" + - "\0062\0042\002\002\003R\003val\")\n\013UInt64NotIn\022\032\n\003val\030\001 \001(\004" + - "B\010\272H\0052\003:\001\000R\003val\"%\n\010UInt64LT\022\031\n\003val\030\001 \001(\004" + - "B\007\272H\0042\002\020\005R\003val\"&\n\tUInt64LTE\022\031\n\003val\030\001 \001(\004" + - "B\007\272H\0042\002\030@R\003val\"%\n\010UInt64GT\022\031\n\003val\030\001 \001(\004B" + - "\007\272H\0042\002 \020R\003val\"&\n\tUInt64GTE\022\031\n\003val\030\001 \001(\004B" + - "\007\272H\0042\002(\010R\003val\")\n\nUInt64GTLT\022\033\n\003val\030\001 \001(\004" + - "B\t\272H\0062\004\020\n \005R\003val\"+\n\014UInt64ExLTGT\022\033\n\003val\030" + - "\001 \001(\004B\t\272H\0062\004\020\005 \nR\003val\"-\n\014UInt64GTELTE\022\035\n" + - "\003val\030\001 \001(\004B\013\272H\0102\006\030\200\002(\200\001R\003val\"/\n\016UInt64Ex" + - "GTELTE\022\035\n\003val\030\001 \001(\004B\013\272H\0102\006\030\200\001(\200\002R\003val\"0\n" + - "\014UInt64Ignore\022 \n\003val\030\001 \001(\004B\016\272H\0132\006\030\200\002(\200\001\320" + - "\001\001R\003val\"3\n\023UInt64IncorrectType\022\034\n\003val\030\001 " + - "\001(\004B\n\272H\007\n\005%\000\000\000\000R\003val\"\036\n\nSInt32None\022\020\n\003va" + - "l\030\001 \001(\021R\003val\"(\n\013SInt32Const\022\031\n\003val\030\001 \001(\021" + - "B\007\272H\004:\002\010\002R\003val\"\'\n\010SInt32In\022\033\n\003val\030\001 \001(\021B" + - "\t\272H\006:\0042\002\004\006R\003val\")\n\013SInt32NotIn\022\032\n\003val\030\001 " + - "\001(\021B\010\272H\005:\003:\001\000R\003val\"%\n\010SInt32LT\022\031\n\003val\030\001 " + - "\001(\021B\007\272H\004:\002\020\000R\003val\"\'\n\tSInt32LTE\022\032\n\003val\030\001 " + - "\001(\021B\010\272H\005:\003\030\200\001R\003val\"%\n\010SInt32GT\022\031\n\003val\030\001 " + - "\001(\021B\007\272H\004:\002 R\003val\"&\n\tSInt32GTE\022\031\n\003val\030\001 " + - "\001(\021B\007\272H\004:\002(\020R\003val\")\n\nSInt32GTLT\022\033\n\003val\030\001" + - " \001(\021B\t\272H\006:\004\020\024 \000R\003val\"+\n\014SInt32ExLTGT\022\033\n\003" + - "val\030\001 \001(\021B\t\272H\006:\004\020\000 \024R\003val\"-\n\014SInt32GTELT" + - "E\022\035\n\003val\030\001 \001(\021B\013\272H\010:\006\030\200\004(\200\002R\003val\"/\n\016SInt" + - "32ExGTELTE\022\035\n\003val\030\001 \001(\021B\013\272H\010:\006\030\200\002(\200\004R\003va" + - "l\"0\n\014SInt32Ignore\022 \n\003val\030\001 \001(\021B\016\272H\013:\006\030\200\004" + - "(\200\002\320\001\001R\003val\"3\n\023SInt32IncorrectType\022\034\n\003va" + - "l\030\001 \001(\021B\n\272H\007\n\005%\000\000\000\000R\003val\"\036\n\nSInt64None\022\020" + - "\n\003val\030\001 \001(\022R\003val\"(\n\013SInt64Const\022\031\n\003val\030\001" + - " \001(\022B\007\272H\004B\002\010\002R\003val\"\'\n\010SInt64In\022\033\n\003val\030\001 " + - "\001(\022B\t\272H\006B\0042\002\004\006R\003val\")\n\013SInt64NotIn\022\032\n\003va" + - "l\030\001 \001(\022B\010\272H\005B\003:\001\000R\003val\"%\n\010SInt64LT\022\031\n\003va" + - "l\030\001 \001(\022B\007\272H\004B\002\020\000R\003val\"\'\n\tSInt64LTE\022\032\n\003va" + - "l\030\001 \001(\022B\010\272H\005B\003\030\200\001R\003val\"%\n\010SInt64GT\022\031\n\003va" + - "l\030\001 \001(\022B\007\272H\004B\002 R\003val\"&\n\tSInt64GTE\022\031\n\003va" + - "l\030\001 \001(\022B\007\272H\004B\002(\020R\003val\")\n\nSInt64GTLT\022\033\n\003v" + - "al\030\001 \001(\022B\t\272H\006B\004\020\024 \000R\003val\"+\n\014SInt64ExLTGT" + - "\022\033\n\003val\030\001 \001(\022B\t\272H\006B\004\020\000 \024R\003val\"-\n\014SInt64G" + - "TELTE\022\035\n\003val\030\001 \001(\022B\013\272H\010B\006\030\200\004(\200\002R\003val\"/\n\016" + - "SInt64ExGTELTE\022\035\n\003val\030\001 \001(\022B\013\272H\010B\006\030\200\002(\200\004" + - "R\003val\"0\n\014SInt64Ignore\022 \n\003val\030\001 \001(\022B\016\272H\013B" + - "\006\030\200\004(\200\002\320\001\001R\003val\"3\n\023SInt64IncorrectType\022\034" + - "\n\003val\030\001 \001(\022B\n\272H\007\n\005%\000\000\000\000R\003val\"\037\n\013Fixed32N" + - "one\022\020\n\003val\030\001 \001(\007R\003val\",\n\014Fixed32Const\022\034\n" + - "\003val\030\001 \001(\007B\n\272H\007J\005\r\001\000\000\000R\003val\".\n\tFixed32In" + - "\022!\n\003val\030\001 \001(\007B\017\272H\014J\n2\010\002\000\000\000\003\000\000\000R\003val\"-\n\014F" + - "ixed32NotIn\022\035\n\003val\030\001 \001(\007B\013\272H\010J\006:\004\000\000\000\000R\003v" + - "al\")\n\tFixed32LT\022\034\n\003val\030\001 \001(\007B\n\272H\007J\005\025\005\000\000\000" + - "R\003val\"*\n\nFixed32LTE\022\034\n\003val\030\001 \001(\007B\n\272H\007J\005\035" + - "@\000\000\000R\003val\")\n\tFixed32GT\022\034\n\003val\030\001 \001(\007B\n\272H\007" + - "J\005%\020\000\000\000R\003val\"*\n\nFixed32GTE\022\034\n\003val\030\001 \001(\007B" + - "\n\272H\007J\005-\010\000\000\000R\003val\"0\n\013Fixed32GTLT\022!\n\003val\030\001" + - " \001(\007B\017\272H\014J\n\025\n\000\000\000%\005\000\000\000R\003val\"2\n\rFixed32ExL" + - "TGT\022!\n\003val\030\001 \001(\007B\017\272H\014J\n\025\005\000\000\000%\n\000\000\000R\003val\"2" + - "\n\rFixed32GTELTE\022!\n\003val\030\001 \001(\007B\017\272H\014J\n\035\000\001\000\000" + - "-\200\000\000\000R\003val\"4\n\017Fixed32ExGTELTE\022!\n\003val\030\001 \001" + - "(\007B\017\272H\014J\n\035\200\000\000\000-\000\001\000\000R\003val\"5\n\rFixed32Ignor" + - "e\022$\n\003val\030\001 \001(\007B\022\272H\017J\n\035\000\001\000\000-\200\000\000\000\320\001\001R\003val\"" + - "4\n\024Fixed32IncorrectType\022\034\n\003val\030\001 \001(\007B\n\272H" + - "\007\n\005%\000\000\000\000R\003val\"\037\n\013Fixed64None\022\020\n\003val\030\001 \001(" + - "\006R\003val\"0\n\014Fixed64Const\022 \n\003val\030\001 \001(\006B\016\272H\013" + - "R\t\t\001\000\000\000\000\000\000\000R\003val\"6\n\tFixed64In\022)\n\003val\030\001 \001" + - "(\006B\027\272H\024R\0222\020\002\000\000\000\000\000\000\000\003\000\000\000\000\000\000\000R\003val\"1\n\014Fixe" + - "d64NotIn\022!\n\003val\030\001 \001(\006B\017\272H\014R\n:\010\000\000\000\000\000\000\000\000R\003" + - "val\"-\n\tFixed64LT\022 \n\003val\030\001 \001(\006B\016\272H\013R\t\021\005\000\000" + - "\000\000\000\000\000R\003val\".\n\nFixed64LTE\022 \n\003val\030\001 \001(\006B\016\272" + - "H\013R\t\031@\000\000\000\000\000\000\000R\003val\"-\n\tFixed64GT\022 \n\003val\030\001" + - " \001(\006B\016\272H\013R\t!\020\000\000\000\000\000\000\000R\003val\".\n\nFixed64GTE\022" + - " \n\003val\030\001 \001(\006B\016\272H\013R\t)\010\000\000\000\000\000\000\000R\003val\"8\n\013Fix" + - "ed64GTLT\022)\n\003val\030\001 \001(\006B\027\272H\024R\022\021\n\000\000\000\000\000\000\000!\005\000" + - "\000\000\000\000\000\000R\003val\":\n\rFixed64ExLTGT\022)\n\003val\030\001 \001(" + - "\006B\027\272H\024R\022\021\005\000\000\000\000\000\000\000!\n\000\000\000\000\000\000\000R\003val\":\n\rFixed" + - "64GTELTE\022)\n\003val\030\001 \001(\006B\027\272H\024R\022\031\000\001\000\000\000\000\000\000)\200\000" + - "\000\000\000\000\000\000R\003val\"<\n\017Fixed64ExGTELTE\022)\n\003val\030\001 " + - "\001(\006B\027\272H\024R\022\031\200\000\000\000\000\000\000\000)\000\001\000\000\000\000\000\000R\003val\"=\n\rFix" + - "ed64Ignore\022,\n\003val\030\001 \001(\006B\032\272H\027R\022\031\000\001\000\000\000\000\000\000)" + - "\200\000\000\000\000\000\000\000\320\001\001R\003val\"4\n\024Fixed64IncorrectType" + - "\022\034\n\003val\030\001 \001(\006B\n\272H\007\n\005%\000\000\000\000R\003val\" \n\014SFixed" + - "32None\022\020\n\003val\030\001 \001(\017R\003val\"-\n\rSFixed32Cons" + - "t\022\034\n\003val\030\001 \001(\017B\n\272H\007Z\005\r\001\000\000\000R\003val\"/\n\nSFixe" + - "d32In\022!\n\003val\030\001 \001(\017B\017\272H\014Z\n2\010\002\000\000\000\003\000\000\000R\003val" + - "\".\n\rSFixed32NotIn\022\035\n\003val\030\001 \001(\017B\013\272H\010Z\006:\004\000" + - "\000\000\000R\003val\"*\n\nSFixed32LT\022\034\n\003val\030\001 \001(\017B\n\272H\007" + - "Z\005\025\000\000\000\000R\003val\"+\n\013SFixed32LTE\022\034\n\003val\030\001 \001(\017" + - "B\n\272H\007Z\005\035@\000\000\000R\003val\"*\n\nSFixed32GT\022\034\n\003val\030\001" + - " \001(\017B\n\272H\007Z\005%\020\000\000\000R\003val\"+\n\013SFixed32GTE\022\034\n\003" + - "val\030\001 \001(\017B\n\272H\007Z\005-\010\000\000\000R\003val\"1\n\014SFixed32GT" + - "LT\022!\n\003val\030\001 \001(\017B\017\272H\014Z\n\025\n\000\000\000%\000\000\000\000R\003val\"3\n" + - "\016SFixed32ExLTGT\022!\n\003val\030\001 \001(\017B\017\272H\014Z\n\025\000\000\000\000" + - "%\n\000\000\000R\003val\"3\n\016SFixed32GTELTE\022!\n\003val\030\001 \001(" + - "\017B\017\272H\014Z\n\035\000\001\000\000-\200\000\000\000R\003val\"5\n\020SFixed32ExGTE" + - "LTE\022!\n\003val\030\001 \001(\017B\017\272H\014Z\n\035\200\000\000\000-\000\001\000\000R\003val\"6" + - "\n\016SFixed32Ignore\022$\n\003val\030\001 \001(\017B\022\272H\017Z\n\035\000\001\000" + - "\000-\200\000\000\000\320\001\001R\003val\"5\n\025SFixed32IncorrectType\022" + - "\034\n\003val\030\001 \001(\017B\n\272H\007\n\005%\000\000\000\000R\003val\" \n\014SFixed6" + - "4None\022\020\n\003val\030\001 \001(\020R\003val\"1\n\rSFixed64Const" + - "\022 \n\003val\030\001 \001(\020B\016\272H\013b\t\t\001\000\000\000\000\000\000\000R\003val\"7\n\nSF" + - "ixed64In\022)\n\003val\030\001 \001(\020B\027\272H\024b\0222\020\002\000\000\000\000\000\000\000\003\000" + - "\000\000\000\000\000\000R\003val\"2\n\rSFixed64NotIn\022!\n\003val\030\001 \001(" + - "\020B\017\272H\014b\n:\010\000\000\000\000\000\000\000\000R\003val\".\n\nSFixed64LT\022 \n" + - "\003val\030\001 \001(\020B\016\272H\013b\t\021\000\000\000\000\000\000\000\000R\003val\"/\n\013SFixe" + - "d64LTE\022 \n\003val\030\001 \001(\020B\016\272H\013b\t\031@\000\000\000\000\000\000\000R\003val" + - "\".\n\nSFixed64GT\022 \n\003val\030\001 \001(\020B\016\272H\013b\t!\020\000\000\000\000" + - "\000\000\000R\003val\"/\n\013SFixed64GTE\022 \n\003val\030\001 \001(\020B\016\272H" + - "\013b\t)\010\000\000\000\000\000\000\000R\003val\"9\n\014SFixed64GTLT\022)\n\003val" + - "\030\001 \001(\020B\027\272H\024b\022\021\n\000\000\000\000\000\000\000!\000\000\000\000\000\000\000\000R\003val\";\n\016" + - "SFixed64ExLTGT\022)\n\003val\030\001 \001(\020B\027\272H\024b\022\021\000\000\000\000\000" + - "\000\000\000!\n\000\000\000\000\000\000\000R\003val\";\n\016SFixed64GTELTE\022)\n\003v" + - "al\030\001 \001(\020B\027\272H\024b\022\031\000\001\000\000\000\000\000\000)\200\000\000\000\000\000\000\000R\003val\"=" + - "\n\020SFixed64ExGTELTE\022)\n\003val\030\001 \001(\020B\027\272H\024b\022\031\200" + - "\000\000\000\000\000\000\000)\000\001\000\000\000\000\000\000R\003val\">\n\016SFixed64Ignore\022" + - ",\n\003val\030\001 \001(\020B\032\272H\027b\022\031\000\001\000\000\000\000\000\000)\200\000\000\000\000\000\000\000\320\001\001" + - "R\003val\"5\n\025SFixed64IncorrectType\022\034\n\003val\030\001 " + - "\001(\020B\n\272H\007\n\005%\000\000\000\000R\003val\":\n\020Int64LTEOptional" + - "\022\036\n\003val\030\001 \001(\003B\007\272H\004\"\002\030@H\000R\003val\210\001\001B\006\n\004_val" + - "B\320\001\n$build.buf.validate.conformance.case" + - "sB\014NumbersProtoP\001\242\002\004BVCC\252\002\036Buf.Validate." + - "Conformance.Cases\312\002\036Buf\\Validate\\Conform" + - "ance\\Cases\342\002*Buf\\Validate\\Conformance\\Ca" + - "ses\\GPBMetadata\352\002!Buf::Validate::Conform" + - "ance::Casesb\006proto3" + "al\"\214\004\n\023Int64BigConstraints\022\"\n\006lt_pos\030\001 \001" + + "(\003B\013\272H\010\"\006\020\246\335\207\244\024R\005ltPos\022\'\n\006lt_neg\030\002 \001(\003B\020" + + "\272H\r\"\013\020\332\242\370\333\353\377\377\377\377\001R\005ltNeg\022\"\n\006gt_pos\030\003 \001(\003B" + + "\013\272H\010\"\006 \246\335\207\244\024R\005gtPos\022\'\n\006gt_neg\030\004 \001(\003B\020\272H\r" + + "\"\013 \332\242\370\333\353\377\377\377\377\001R\005gtNeg\022$\n\007lte_pos\030\005 \001(\003B\013\272" + + "H\010\"\006\030\246\335\207\244\024R\006ltePos\022)\n\007lte_neg\030\006 \001(\003B\020\272H\r" + + "\"\013\030\332\242\370\333\353\377\377\377\377\001R\006lteNeg\022$\n\007gte_pos\030\007 \001(\003B\013" + + "\272H\010\"\006(\246\335\207\244\024R\006gtePos\022)\n\007gte_neg\030\010 \001(\003B\020\272H" + + "\r\"\013(\332\242\370\333\353\377\377\377\377\001R\006gteNeg\022.\n\014constant_pos\030\t" + + " \001(\003B\013\272H\010\"\006\010\246\335\207\244\024R\013constantPos\0223\n\014consta" + + "nt_neg\030\n \001(\003B\020\272H\r\"\013\010\332\242\370\333\353\377\377\377\377\001R\013constant" + + "Neg\022&\n\002in\030\013 \001(\003B\026\272H\023\"\0212\017\246\335\207\244\024\332\242\370\333\353\377\377\377\377\001R" + + "\002in\022,\n\005notin\030\014 \001(\003B\026\272H\023\"\021:\017\246\335\207\244\024\332\242\370\333\353\377\377\377" + + "\377\001R\005notin\"2\n\022Int64IncorrectType\022\034\n\003val\030\001" + + " \001(\003B\n\272H\007\n\005%\000\000\000\000R\003val\"\036\n\nUInt32None\022\020\n\003v" + + "al\030\001 \001(\rR\003val\"(\n\013UInt32Const\022\031\n\003val\030\001 \001(" + + "\rB\007\272H\004*\002\010\001R\003val\"\'\n\010UInt32In\022\033\n\003val\030\001 \001(\r" + + "B\t\272H\006*\0042\002\002\003R\003val\")\n\013UInt32NotIn\022\032\n\003val\030\001" + + " \001(\rB\010\272H\005*\003:\001\000R\003val\"%\n\010UInt32LT\022\031\n\003val\030\001" + + " \001(\rB\007\272H\004*\002\020\005R\003val\"&\n\tUInt32LTE\022\031\n\003val\030\001" + + " \001(\rB\007\272H\004*\002\030@R\003val\"%\n\010UInt32GT\022\031\n\003val\030\001 " + + "\001(\rB\007\272H\004*\002 \020R\003val\"&\n\tUInt32GTE\022\031\n\003val\030\001 " + + "\001(\rB\007\272H\004*\002(\010R\003val\")\n\nUInt32GTLT\022\033\n\003val\030\001" + + " \001(\rB\t\272H\006*\004\020\n \005R\003val\"+\n\014UInt32ExLTGT\022\033\n\003" + + "val\030\001 \001(\rB\t\272H\006*\004\020\005 \nR\003val\"-\n\014UInt32GTELT" + + "E\022\035\n\003val\030\001 \001(\rB\013\272H\010*\006\030\200\002(\200\001R\003val\"/\n\016UInt" + + "32ExGTELTE\022\035\n\003val\030\001 \001(\rB\013\272H\010*\006\030\200\001(\200\002R\003va" + + "l\"0\n\014UInt32Ignore\022 \n\003val\030\001 \001(\rB\016\272H\013*\006\030\200\002" + + "(\200\001\320\001\001R\003val\"3\n\023UInt32IncorrectType\022\034\n\003va" + + "l\030\001 \001(\rB\n\272H\007\n\005%\000\000\000\000R\003val\"\036\n\nUInt64None\022\020" + + "\n\003val\030\001 \001(\004R\003val\"(\n\013UInt64Const\022\031\n\003val\030\001" + + " \001(\004B\007\272H\0042\002\010\001R\003val\"\'\n\010UInt64In\022\033\n\003val\030\001 " + + "\001(\004B\t\272H\0062\0042\002\002\003R\003val\")\n\013UInt64NotIn\022\032\n\003va" + + "l\030\001 \001(\004B\010\272H\0052\003:\001\000R\003val\"%\n\010UInt64LT\022\031\n\003va" + + "l\030\001 \001(\004B\007\272H\0042\002\020\005R\003val\"&\n\tUInt64LTE\022\031\n\003va" + + "l\030\001 \001(\004B\007\272H\0042\002\030@R\003val\"%\n\010UInt64GT\022\031\n\003val" + + "\030\001 \001(\004B\007\272H\0042\002 \020R\003val\"&\n\tUInt64GTE\022\031\n\003val" + + "\030\001 \001(\004B\007\272H\0042\002(\010R\003val\")\n\nUInt64GTLT\022\033\n\003va" + + "l\030\001 \001(\004B\t\272H\0062\004\020\n \005R\003val\"+\n\014UInt64ExLTGT\022" + + "\033\n\003val\030\001 \001(\004B\t\272H\0062\004\020\005 \nR\003val\"-\n\014UInt64GT" + + "ELTE\022\035\n\003val\030\001 \001(\004B\013\272H\0102\006\030\200\002(\200\001R\003val\"/\n\016U" + + "Int64ExGTELTE\022\035\n\003val\030\001 \001(\004B\013\272H\0102\006\030\200\001(\200\002R" + + "\003val\"0\n\014UInt64Ignore\022 \n\003val\030\001 \001(\004B\016\272H\0132\006" + + "\030\200\002(\200\001\320\001\001R\003val\"3\n\023UInt64IncorrectType\022\034\n" + + "\003val\030\001 \001(\004B\n\272H\007\n\005%\000\000\000\000R\003val\"\036\n\nSInt32Non" + + "e\022\020\n\003val\030\001 \001(\021R\003val\"(\n\013SInt32Const\022\031\n\003va" + + "l\030\001 \001(\021B\007\272H\004:\002\010\002R\003val\"\'\n\010SInt32In\022\033\n\003val" + + "\030\001 \001(\021B\t\272H\006:\0042\002\004\006R\003val\")\n\013SInt32NotIn\022\032\n" + + "\003val\030\001 \001(\021B\010\272H\005:\003:\001\000R\003val\"%\n\010SInt32LT\022\031\n" + + "\003val\030\001 \001(\021B\007\272H\004:\002\020\000R\003val\"\'\n\tSInt32LTE\022\032\n" + + "\003val\030\001 \001(\021B\010\272H\005:\003\030\200\001R\003val\"%\n\010SInt32GT\022\031\n" + + "\003val\030\001 \001(\021B\007\272H\004:\002 R\003val\"&\n\tSInt32GTE\022\031\n" + + "\003val\030\001 \001(\021B\007\272H\004:\002(\020R\003val\")\n\nSInt32GTLT\022\033" + + "\n\003val\030\001 \001(\021B\t\272H\006:\004\020\024 \000R\003val\"+\n\014SInt32ExL" + + "TGT\022\033\n\003val\030\001 \001(\021B\t\272H\006:\004\020\000 \024R\003val\"-\n\014SInt" + + "32GTELTE\022\035\n\003val\030\001 \001(\021B\013\272H\010:\006\030\200\004(\200\002R\003val\"" + + "/\n\016SInt32ExGTELTE\022\035\n\003val\030\001 \001(\021B\013\272H\010:\006\030\200\002" + + "(\200\004R\003val\"0\n\014SInt32Ignore\022 \n\003val\030\001 \001(\021B\016\272" + + "H\013:\006\030\200\004(\200\002\320\001\001R\003val\"3\n\023SInt32IncorrectTyp" + + "e\022\034\n\003val\030\001 \001(\021B\n\272H\007\n\005%\000\000\000\000R\003val\"\036\n\nSInt6" + + "4None\022\020\n\003val\030\001 \001(\022R\003val\"(\n\013SInt64Const\022\031" + + "\n\003val\030\001 \001(\022B\007\272H\004B\002\010\002R\003val\"\'\n\010SInt64In\022\033\n" + + "\003val\030\001 \001(\022B\t\272H\006B\0042\002\004\006R\003val\")\n\013SInt64NotI" + + "n\022\032\n\003val\030\001 \001(\022B\010\272H\005B\003:\001\000R\003val\"%\n\010SInt64L" + + "T\022\031\n\003val\030\001 \001(\022B\007\272H\004B\002\020\000R\003val\"\'\n\tSInt64LT" + + "E\022\032\n\003val\030\001 \001(\022B\010\272H\005B\003\030\200\001R\003val\"%\n\010SInt64G" + + "T\022\031\n\003val\030\001 \001(\022B\007\272H\004B\002 R\003val\"&\n\tSInt64GT" + + "E\022\031\n\003val\030\001 \001(\022B\007\272H\004B\002(\020R\003val\")\n\nSInt64GT" + + "LT\022\033\n\003val\030\001 \001(\022B\t\272H\006B\004\020\024 \000R\003val\"+\n\014SInt6" + + "4ExLTGT\022\033\n\003val\030\001 \001(\022B\t\272H\006B\004\020\000 \024R\003val\"-\n\014" + + "SInt64GTELTE\022\035\n\003val\030\001 \001(\022B\013\272H\010B\006\030\200\004(\200\002R\003" + + "val\"/\n\016SInt64ExGTELTE\022\035\n\003val\030\001 \001(\022B\013\272H\010B" + + "\006\030\200\002(\200\004R\003val\"0\n\014SInt64Ignore\022 \n\003val\030\001 \001(" + + "\022B\016\272H\013B\006\030\200\004(\200\002\320\001\001R\003val\"3\n\023SInt64Incorrec" + + "tType\022\034\n\003val\030\001 \001(\022B\n\272H\007\n\005%\000\000\000\000R\003val\"\037\n\013F" + + "ixed32None\022\020\n\003val\030\001 \001(\007R\003val\",\n\014Fixed32C" + + "onst\022\034\n\003val\030\001 \001(\007B\n\272H\007J\005\r\001\000\000\000R\003val\".\n\tFi" + + "xed32In\022!\n\003val\030\001 \001(\007B\017\272H\014J\n2\010\002\000\000\000\003\000\000\000R\003v" + + "al\"-\n\014Fixed32NotIn\022\035\n\003val\030\001 \001(\007B\013\272H\010J\006:\004" + + "\000\000\000\000R\003val\")\n\tFixed32LT\022\034\n\003val\030\001 \001(\007B\n\272H\007" + + "J\005\025\005\000\000\000R\003val\"*\n\nFixed32LTE\022\034\n\003val\030\001 \001(\007B" + + "\n\272H\007J\005\035@\000\000\000R\003val\")\n\tFixed32GT\022\034\n\003val\030\001 \001" + + "(\007B\n\272H\007J\005%\020\000\000\000R\003val\"*\n\nFixed32GTE\022\034\n\003val" + + "\030\001 \001(\007B\n\272H\007J\005-\010\000\000\000R\003val\"0\n\013Fixed32GTLT\022!" + + "\n\003val\030\001 \001(\007B\017\272H\014J\n\025\n\000\000\000%\005\000\000\000R\003val\"2\n\rFix" + + "ed32ExLTGT\022!\n\003val\030\001 \001(\007B\017\272H\014J\n\025\005\000\000\000%\n\000\000\000" + + "R\003val\"2\n\rFixed32GTELTE\022!\n\003val\030\001 \001(\007B\017\272H\014" + + "J\n\035\000\001\000\000-\200\000\000\000R\003val\"4\n\017Fixed32ExGTELTE\022!\n\003" + + "val\030\001 \001(\007B\017\272H\014J\n\035\200\000\000\000-\000\001\000\000R\003val\"5\n\rFixed" + + "32Ignore\022$\n\003val\030\001 \001(\007B\022\272H\017J\n\035\000\001\000\000-\200\000\000\000\320\001" + + "\001R\003val\"4\n\024Fixed32IncorrectType\022\034\n\003val\030\001 " + + "\001(\007B\n\272H\007\n\005%\000\000\000\000R\003val\"\037\n\013Fixed64None\022\020\n\003v" + + "al\030\001 \001(\006R\003val\"0\n\014Fixed64Const\022 \n\003val\030\001 \001" + + "(\006B\016\272H\013R\t\t\001\000\000\000\000\000\000\000R\003val\"6\n\tFixed64In\022)\n\003" + + "val\030\001 \001(\006B\027\272H\024R\0222\020\002\000\000\000\000\000\000\000\003\000\000\000\000\000\000\000R\003val\"" + + "1\n\014Fixed64NotIn\022!\n\003val\030\001 \001(\006B\017\272H\014R\n:\010\000\000\000" + + "\000\000\000\000\000R\003val\"-\n\tFixed64LT\022 \n\003val\030\001 \001(\006B\016\272H" + + "\013R\t\021\005\000\000\000\000\000\000\000R\003val\".\n\nFixed64LTE\022 \n\003val\030\001" + + " \001(\006B\016\272H\013R\t\031@\000\000\000\000\000\000\000R\003val\"-\n\tFixed64GT\022 " + + "\n\003val\030\001 \001(\006B\016\272H\013R\t!\020\000\000\000\000\000\000\000R\003val\".\n\nFixe" + + "d64GTE\022 \n\003val\030\001 \001(\006B\016\272H\013R\t)\010\000\000\000\000\000\000\000R\003val" + + "\"8\n\013Fixed64GTLT\022)\n\003val\030\001 \001(\006B\027\272H\024R\022\021\n\000\000\000" + + "\000\000\000\000!\005\000\000\000\000\000\000\000R\003val\":\n\rFixed64ExLTGT\022)\n\003v" + + "al\030\001 \001(\006B\027\272H\024R\022\021\005\000\000\000\000\000\000\000!\n\000\000\000\000\000\000\000R\003val\":" + + "\n\rFixed64GTELTE\022)\n\003val\030\001 \001(\006B\027\272H\024R\022\031\000\001\000\000" + + "\000\000\000\000)\200\000\000\000\000\000\000\000R\003val\"<\n\017Fixed64ExGTELTE\022)\n" + + "\003val\030\001 \001(\006B\027\272H\024R\022\031\200\000\000\000\000\000\000\000)\000\001\000\000\000\000\000\000R\003val" + + "\"=\n\rFixed64Ignore\022,\n\003val\030\001 \001(\006B\032\272H\027R\022\031\000\001" + + "\000\000\000\000\000\000)\200\000\000\000\000\000\000\000\320\001\001R\003val\"4\n\024Fixed64Incorr" + + "ectType\022\034\n\003val\030\001 \001(\006B\n\272H\007\n\005%\000\000\000\000R\003val\" \n" + + "\014SFixed32None\022\020\n\003val\030\001 \001(\017R\003val\"-\n\rSFixe" + + "d32Const\022\034\n\003val\030\001 \001(\017B\n\272H\007Z\005\r\001\000\000\000R\003val\"/" + + "\n\nSFixed32In\022!\n\003val\030\001 \001(\017B\017\272H\014Z\n2\010\002\000\000\000\003\000" + + "\000\000R\003val\".\n\rSFixed32NotIn\022\035\n\003val\030\001 \001(\017B\013\272" + + "H\010Z\006:\004\000\000\000\000R\003val\"*\n\nSFixed32LT\022\034\n\003val\030\001 \001" + + "(\017B\n\272H\007Z\005\025\000\000\000\000R\003val\"+\n\013SFixed32LTE\022\034\n\003va" + + "l\030\001 \001(\017B\n\272H\007Z\005\035@\000\000\000R\003val\"*\n\nSFixed32GT\022\034" + + "\n\003val\030\001 \001(\017B\n\272H\007Z\005%\020\000\000\000R\003val\"+\n\013SFixed32" + + "GTE\022\034\n\003val\030\001 \001(\017B\n\272H\007Z\005-\010\000\000\000R\003val\"1\n\014SFi" + + "xed32GTLT\022!\n\003val\030\001 \001(\017B\017\272H\014Z\n\025\n\000\000\000%\000\000\000\000R" + + "\003val\"3\n\016SFixed32ExLTGT\022!\n\003val\030\001 \001(\017B\017\272H\014" + + "Z\n\025\000\000\000\000%\n\000\000\000R\003val\"3\n\016SFixed32GTELTE\022!\n\003v" + + "al\030\001 \001(\017B\017\272H\014Z\n\035\000\001\000\000-\200\000\000\000R\003val\"5\n\020SFixed" + + "32ExGTELTE\022!\n\003val\030\001 \001(\017B\017\272H\014Z\n\035\200\000\000\000-\000\001\000\000" + + "R\003val\"6\n\016SFixed32Ignore\022$\n\003val\030\001 \001(\017B\022\272H" + + "\017Z\n\035\000\001\000\000-\200\000\000\000\320\001\001R\003val\"5\n\025SFixed32Incorre" + + "ctType\022\034\n\003val\030\001 \001(\017B\n\272H\007\n\005%\000\000\000\000R\003val\" \n\014" + + "SFixed64None\022\020\n\003val\030\001 \001(\020R\003val\"1\n\rSFixed" + + "64Const\022 \n\003val\030\001 \001(\020B\016\272H\013b\t\t\001\000\000\000\000\000\000\000R\003va" + + "l\"7\n\nSFixed64In\022)\n\003val\030\001 \001(\020B\027\272H\024b\0222\020\002\000\000" + + "\000\000\000\000\000\003\000\000\000\000\000\000\000R\003val\"2\n\rSFixed64NotIn\022!\n\003v" + + "al\030\001 \001(\020B\017\272H\014b\n:\010\000\000\000\000\000\000\000\000R\003val\".\n\nSFixed" + + "64LT\022 \n\003val\030\001 \001(\020B\016\272H\013b\t\021\000\000\000\000\000\000\000\000R\003val\"/" + + "\n\013SFixed64LTE\022 \n\003val\030\001 \001(\020B\016\272H\013b\t\031@\000\000\000\000\000" + + "\000\000R\003val\".\n\nSFixed64GT\022 \n\003val\030\001 \001(\020B\016\272H\013b" + + "\t!\020\000\000\000\000\000\000\000R\003val\"/\n\013SFixed64GTE\022 \n\003val\030\001 " + + "\001(\020B\016\272H\013b\t)\010\000\000\000\000\000\000\000R\003val\"9\n\014SFixed64GTLT" + + "\022)\n\003val\030\001 \001(\020B\027\272H\024b\022\021\n\000\000\000\000\000\000\000!\000\000\000\000\000\000\000\000R\003" + + "val\";\n\016SFixed64ExLTGT\022)\n\003val\030\001 \001(\020B\027\272H\024b" + + "\022\021\000\000\000\000\000\000\000\000!\n\000\000\000\000\000\000\000R\003val\";\n\016SFixed64GTEL" + + "TE\022)\n\003val\030\001 \001(\020B\027\272H\024b\022\031\000\001\000\000\000\000\000\000)\200\000\000\000\000\000\000\000" + + "R\003val\"=\n\020SFixed64ExGTELTE\022)\n\003val\030\001 \001(\020B\027" + + "\272H\024b\022\031\200\000\000\000\000\000\000\000)\000\001\000\000\000\000\000\000R\003val\">\n\016SFixed64" + + "Ignore\022,\n\003val\030\001 \001(\020B\032\272H\027b\022\031\000\001\000\000\000\000\000\000)\200\000\000\000" + + "\000\000\000\000\320\001\001R\003val\"5\n\025SFixed64IncorrectType\022\034\n" + + "\003val\030\001 \001(\020B\n\272H\007\n\005%\000\000\000\000R\003val\":\n\020Int64LTEO" + + "ptional\022\036\n\003val\030\001 \001(\003B\007\272H\004\"\002\030@H\000R\003val\210\001\001B" + + "\006\n\004_valB\320\001\n$build.buf.validate.conforman" + + "ce.casesB\014NumbersProtoP\001\242\002\004BVCC\252\002\036Buf.Va" + + "lidate.Conformance.Cases\312\002\036Buf\\Validate\\" + + "Conformance\\Cases\342\002*Buf\\Validate\\Conform" + + "ance\\Cases\\GPBMetadata\352\002!Buf::Validate::" + + "Conformance::Casesb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -1433,686 +1451,692 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64Ignore_descriptor, new java.lang.String[] { "Val", }); - internal_static_buf_validate_conformance_cases_Int64IncorrectType_descriptor = + internal_static_buf_validate_conformance_cases_Int64BigConstraints_descriptor = getDescriptor().getMessageTypes().get(57); + internal_static_buf_validate_conformance_cases_Int64BigConstraints_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_Int64BigConstraints_descriptor, + new java.lang.String[] { "LtPos", "LtNeg", "GtPos", "GtNeg", "LtePos", "LteNeg", "GtePos", "GteNeg", "ConstantPos", "ConstantNeg", "In", "Notin", }); + internal_static_buf_validate_conformance_cases_Int64IncorrectType_descriptor = + getDescriptor().getMessageTypes().get(58); internal_static_buf_validate_conformance_cases_Int64IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64IncorrectType_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32None_descriptor = - getDescriptor().getMessageTypes().get(58); + getDescriptor().getMessageTypes().get(59); internal_static_buf_validate_conformance_cases_UInt32None_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32Const_descriptor = - getDescriptor().getMessageTypes().get(59); + getDescriptor().getMessageTypes().get(60); internal_static_buf_validate_conformance_cases_UInt32Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32In_descriptor = - getDescriptor().getMessageTypes().get(60); + getDescriptor().getMessageTypes().get(61); internal_static_buf_validate_conformance_cases_UInt32In_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32NotIn_descriptor = - getDescriptor().getMessageTypes().get(61); + getDescriptor().getMessageTypes().get(62); internal_static_buf_validate_conformance_cases_UInt32NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32LT_descriptor = - getDescriptor().getMessageTypes().get(62); + getDescriptor().getMessageTypes().get(63); internal_static_buf_validate_conformance_cases_UInt32LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32LTE_descriptor = - getDescriptor().getMessageTypes().get(63); + getDescriptor().getMessageTypes().get(64); internal_static_buf_validate_conformance_cases_UInt32LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32GT_descriptor = - getDescriptor().getMessageTypes().get(64); + getDescriptor().getMessageTypes().get(65); internal_static_buf_validate_conformance_cases_UInt32GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32GTE_descriptor = - getDescriptor().getMessageTypes().get(65); + getDescriptor().getMessageTypes().get(66); internal_static_buf_validate_conformance_cases_UInt32GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32GTLT_descriptor = - getDescriptor().getMessageTypes().get(66); + getDescriptor().getMessageTypes().get(67); internal_static_buf_validate_conformance_cases_UInt32GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(67); + getDescriptor().getMessageTypes().get(68); internal_static_buf_validate_conformance_cases_UInt32ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32GTELTE_descriptor = - getDescriptor().getMessageTypes().get(68); + getDescriptor().getMessageTypes().get(69); internal_static_buf_validate_conformance_cases_UInt32GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(69); + getDescriptor().getMessageTypes().get(70); internal_static_buf_validate_conformance_cases_UInt32ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32Ignore_descriptor = - getDescriptor().getMessageTypes().get(70); + getDescriptor().getMessageTypes().get(71); internal_static_buf_validate_conformance_cases_UInt32Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt32IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(71); + getDescriptor().getMessageTypes().get(72); internal_static_buf_validate_conformance_cases_UInt32IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt32IncorrectType_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64None_descriptor = - getDescriptor().getMessageTypes().get(72); + getDescriptor().getMessageTypes().get(73); internal_static_buf_validate_conformance_cases_UInt64None_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64Const_descriptor = - getDescriptor().getMessageTypes().get(73); + getDescriptor().getMessageTypes().get(74); internal_static_buf_validate_conformance_cases_UInt64Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64In_descriptor = - getDescriptor().getMessageTypes().get(74); + getDescriptor().getMessageTypes().get(75); internal_static_buf_validate_conformance_cases_UInt64In_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64NotIn_descriptor = - getDescriptor().getMessageTypes().get(75); + getDescriptor().getMessageTypes().get(76); internal_static_buf_validate_conformance_cases_UInt64NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64LT_descriptor = - getDescriptor().getMessageTypes().get(76); + getDescriptor().getMessageTypes().get(77); internal_static_buf_validate_conformance_cases_UInt64LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64LTE_descriptor = - getDescriptor().getMessageTypes().get(77); + getDescriptor().getMessageTypes().get(78); internal_static_buf_validate_conformance_cases_UInt64LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64GT_descriptor = - getDescriptor().getMessageTypes().get(78); + getDescriptor().getMessageTypes().get(79); internal_static_buf_validate_conformance_cases_UInt64GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64GTE_descriptor = - getDescriptor().getMessageTypes().get(79); + getDescriptor().getMessageTypes().get(80); internal_static_buf_validate_conformance_cases_UInt64GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64GTLT_descriptor = - getDescriptor().getMessageTypes().get(80); + getDescriptor().getMessageTypes().get(81); internal_static_buf_validate_conformance_cases_UInt64GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(81); + getDescriptor().getMessageTypes().get(82); internal_static_buf_validate_conformance_cases_UInt64ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64GTELTE_descriptor = - getDescriptor().getMessageTypes().get(82); + getDescriptor().getMessageTypes().get(83); internal_static_buf_validate_conformance_cases_UInt64GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(83); + getDescriptor().getMessageTypes().get(84); internal_static_buf_validate_conformance_cases_UInt64ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64Ignore_descriptor = - getDescriptor().getMessageTypes().get(84); + getDescriptor().getMessageTypes().get(85); internal_static_buf_validate_conformance_cases_UInt64Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_UInt64IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(85); + getDescriptor().getMessageTypes().get(86); internal_static_buf_validate_conformance_cases_UInt64IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_UInt64IncorrectType_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32None_descriptor = - getDescriptor().getMessageTypes().get(86); + getDescriptor().getMessageTypes().get(87); internal_static_buf_validate_conformance_cases_SInt32None_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32Const_descriptor = - getDescriptor().getMessageTypes().get(87); + getDescriptor().getMessageTypes().get(88); internal_static_buf_validate_conformance_cases_SInt32Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32In_descriptor = - getDescriptor().getMessageTypes().get(88); + getDescriptor().getMessageTypes().get(89); internal_static_buf_validate_conformance_cases_SInt32In_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32NotIn_descriptor = - getDescriptor().getMessageTypes().get(89); + getDescriptor().getMessageTypes().get(90); internal_static_buf_validate_conformance_cases_SInt32NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32LT_descriptor = - getDescriptor().getMessageTypes().get(90); + getDescriptor().getMessageTypes().get(91); internal_static_buf_validate_conformance_cases_SInt32LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32LTE_descriptor = - getDescriptor().getMessageTypes().get(91); + getDescriptor().getMessageTypes().get(92); internal_static_buf_validate_conformance_cases_SInt32LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32GT_descriptor = - getDescriptor().getMessageTypes().get(92); + getDescriptor().getMessageTypes().get(93); internal_static_buf_validate_conformance_cases_SInt32GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32GTE_descriptor = - getDescriptor().getMessageTypes().get(93); + getDescriptor().getMessageTypes().get(94); internal_static_buf_validate_conformance_cases_SInt32GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32GTLT_descriptor = - getDescriptor().getMessageTypes().get(94); + getDescriptor().getMessageTypes().get(95); internal_static_buf_validate_conformance_cases_SInt32GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(95); + getDescriptor().getMessageTypes().get(96); internal_static_buf_validate_conformance_cases_SInt32ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32GTELTE_descriptor = - getDescriptor().getMessageTypes().get(96); + getDescriptor().getMessageTypes().get(97); internal_static_buf_validate_conformance_cases_SInt32GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(97); + getDescriptor().getMessageTypes().get(98); internal_static_buf_validate_conformance_cases_SInt32ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32Ignore_descriptor = - getDescriptor().getMessageTypes().get(98); + getDescriptor().getMessageTypes().get(99); internal_static_buf_validate_conformance_cases_SInt32Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt32IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(99); + getDescriptor().getMessageTypes().get(100); internal_static_buf_validate_conformance_cases_SInt32IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt32IncorrectType_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64None_descriptor = - getDescriptor().getMessageTypes().get(100); + getDescriptor().getMessageTypes().get(101); internal_static_buf_validate_conformance_cases_SInt64None_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64Const_descriptor = - getDescriptor().getMessageTypes().get(101); + getDescriptor().getMessageTypes().get(102); internal_static_buf_validate_conformance_cases_SInt64Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64In_descriptor = - getDescriptor().getMessageTypes().get(102); + getDescriptor().getMessageTypes().get(103); internal_static_buf_validate_conformance_cases_SInt64In_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64NotIn_descriptor = - getDescriptor().getMessageTypes().get(103); + getDescriptor().getMessageTypes().get(104); internal_static_buf_validate_conformance_cases_SInt64NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64LT_descriptor = - getDescriptor().getMessageTypes().get(104); + getDescriptor().getMessageTypes().get(105); internal_static_buf_validate_conformance_cases_SInt64LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64LTE_descriptor = - getDescriptor().getMessageTypes().get(105); + getDescriptor().getMessageTypes().get(106); internal_static_buf_validate_conformance_cases_SInt64LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64GT_descriptor = - getDescriptor().getMessageTypes().get(106); + getDescriptor().getMessageTypes().get(107); internal_static_buf_validate_conformance_cases_SInt64GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64GTE_descriptor = - getDescriptor().getMessageTypes().get(107); + getDescriptor().getMessageTypes().get(108); internal_static_buf_validate_conformance_cases_SInt64GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64GTLT_descriptor = - getDescriptor().getMessageTypes().get(108); + getDescriptor().getMessageTypes().get(109); internal_static_buf_validate_conformance_cases_SInt64GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(109); + getDescriptor().getMessageTypes().get(110); internal_static_buf_validate_conformance_cases_SInt64ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64GTELTE_descriptor = - getDescriptor().getMessageTypes().get(110); + getDescriptor().getMessageTypes().get(111); internal_static_buf_validate_conformance_cases_SInt64GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(111); + getDescriptor().getMessageTypes().get(112); internal_static_buf_validate_conformance_cases_SInt64ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64Ignore_descriptor = - getDescriptor().getMessageTypes().get(112); + getDescriptor().getMessageTypes().get(113); internal_static_buf_validate_conformance_cases_SInt64Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SInt64IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(113); + getDescriptor().getMessageTypes().get(114); internal_static_buf_validate_conformance_cases_SInt64IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SInt64IncorrectType_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32None_descriptor = - getDescriptor().getMessageTypes().get(114); + getDescriptor().getMessageTypes().get(115); internal_static_buf_validate_conformance_cases_Fixed32None_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32Const_descriptor = - getDescriptor().getMessageTypes().get(115); + getDescriptor().getMessageTypes().get(116); internal_static_buf_validate_conformance_cases_Fixed32Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32In_descriptor = - getDescriptor().getMessageTypes().get(116); + getDescriptor().getMessageTypes().get(117); internal_static_buf_validate_conformance_cases_Fixed32In_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32NotIn_descriptor = - getDescriptor().getMessageTypes().get(117); + getDescriptor().getMessageTypes().get(118); internal_static_buf_validate_conformance_cases_Fixed32NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32LT_descriptor = - getDescriptor().getMessageTypes().get(118); + getDescriptor().getMessageTypes().get(119); internal_static_buf_validate_conformance_cases_Fixed32LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32LTE_descriptor = - getDescriptor().getMessageTypes().get(119); + getDescriptor().getMessageTypes().get(120); internal_static_buf_validate_conformance_cases_Fixed32LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32GT_descriptor = - getDescriptor().getMessageTypes().get(120); + getDescriptor().getMessageTypes().get(121); internal_static_buf_validate_conformance_cases_Fixed32GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32GTE_descriptor = - getDescriptor().getMessageTypes().get(121); + getDescriptor().getMessageTypes().get(122); internal_static_buf_validate_conformance_cases_Fixed32GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32GTLT_descriptor = - getDescriptor().getMessageTypes().get(122); + getDescriptor().getMessageTypes().get(123); internal_static_buf_validate_conformance_cases_Fixed32GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(123); + getDescriptor().getMessageTypes().get(124); internal_static_buf_validate_conformance_cases_Fixed32ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32GTELTE_descriptor = - getDescriptor().getMessageTypes().get(124); + getDescriptor().getMessageTypes().get(125); internal_static_buf_validate_conformance_cases_Fixed32GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(125); + getDescriptor().getMessageTypes().get(126); internal_static_buf_validate_conformance_cases_Fixed32ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32Ignore_descriptor = - getDescriptor().getMessageTypes().get(126); + getDescriptor().getMessageTypes().get(127); internal_static_buf_validate_conformance_cases_Fixed32Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed32IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(127); + getDescriptor().getMessageTypes().get(128); internal_static_buf_validate_conformance_cases_Fixed32IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed32IncorrectType_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64None_descriptor = - getDescriptor().getMessageTypes().get(128); + getDescriptor().getMessageTypes().get(129); internal_static_buf_validate_conformance_cases_Fixed64None_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64Const_descriptor = - getDescriptor().getMessageTypes().get(129); + getDescriptor().getMessageTypes().get(130); internal_static_buf_validate_conformance_cases_Fixed64Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64In_descriptor = - getDescriptor().getMessageTypes().get(130); + getDescriptor().getMessageTypes().get(131); internal_static_buf_validate_conformance_cases_Fixed64In_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64NotIn_descriptor = - getDescriptor().getMessageTypes().get(131); + getDescriptor().getMessageTypes().get(132); internal_static_buf_validate_conformance_cases_Fixed64NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64LT_descriptor = - getDescriptor().getMessageTypes().get(132); + getDescriptor().getMessageTypes().get(133); internal_static_buf_validate_conformance_cases_Fixed64LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64LTE_descriptor = - getDescriptor().getMessageTypes().get(133); + getDescriptor().getMessageTypes().get(134); internal_static_buf_validate_conformance_cases_Fixed64LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64GT_descriptor = - getDescriptor().getMessageTypes().get(134); + getDescriptor().getMessageTypes().get(135); internal_static_buf_validate_conformance_cases_Fixed64GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64GTE_descriptor = - getDescriptor().getMessageTypes().get(135); + getDescriptor().getMessageTypes().get(136); internal_static_buf_validate_conformance_cases_Fixed64GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64GTLT_descriptor = - getDescriptor().getMessageTypes().get(136); + getDescriptor().getMessageTypes().get(137); internal_static_buf_validate_conformance_cases_Fixed64GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(137); + getDescriptor().getMessageTypes().get(138); internal_static_buf_validate_conformance_cases_Fixed64ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64GTELTE_descriptor = - getDescriptor().getMessageTypes().get(138); + getDescriptor().getMessageTypes().get(139); internal_static_buf_validate_conformance_cases_Fixed64GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(139); + getDescriptor().getMessageTypes().get(140); internal_static_buf_validate_conformance_cases_Fixed64ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64Ignore_descriptor = - getDescriptor().getMessageTypes().get(140); + getDescriptor().getMessageTypes().get(141); internal_static_buf_validate_conformance_cases_Fixed64Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Fixed64IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(141); + getDescriptor().getMessageTypes().get(142); internal_static_buf_validate_conformance_cases_Fixed64IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Fixed64IncorrectType_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32None_descriptor = - getDescriptor().getMessageTypes().get(142); + getDescriptor().getMessageTypes().get(143); internal_static_buf_validate_conformance_cases_SFixed32None_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32Const_descriptor = - getDescriptor().getMessageTypes().get(143); + getDescriptor().getMessageTypes().get(144); internal_static_buf_validate_conformance_cases_SFixed32Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32In_descriptor = - getDescriptor().getMessageTypes().get(144); + getDescriptor().getMessageTypes().get(145); internal_static_buf_validate_conformance_cases_SFixed32In_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32NotIn_descriptor = - getDescriptor().getMessageTypes().get(145); + getDescriptor().getMessageTypes().get(146); internal_static_buf_validate_conformance_cases_SFixed32NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32LT_descriptor = - getDescriptor().getMessageTypes().get(146); + getDescriptor().getMessageTypes().get(147); internal_static_buf_validate_conformance_cases_SFixed32LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32LTE_descriptor = - getDescriptor().getMessageTypes().get(147); + getDescriptor().getMessageTypes().get(148); internal_static_buf_validate_conformance_cases_SFixed32LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32GT_descriptor = - getDescriptor().getMessageTypes().get(148); + getDescriptor().getMessageTypes().get(149); internal_static_buf_validate_conformance_cases_SFixed32GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32GTE_descriptor = - getDescriptor().getMessageTypes().get(149); + getDescriptor().getMessageTypes().get(150); internal_static_buf_validate_conformance_cases_SFixed32GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32GTLT_descriptor = - getDescriptor().getMessageTypes().get(150); + getDescriptor().getMessageTypes().get(151); internal_static_buf_validate_conformance_cases_SFixed32GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(151); + getDescriptor().getMessageTypes().get(152); internal_static_buf_validate_conformance_cases_SFixed32ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32GTELTE_descriptor = - getDescriptor().getMessageTypes().get(152); + getDescriptor().getMessageTypes().get(153); internal_static_buf_validate_conformance_cases_SFixed32GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(153); + getDescriptor().getMessageTypes().get(154); internal_static_buf_validate_conformance_cases_SFixed32ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32Ignore_descriptor = - getDescriptor().getMessageTypes().get(154); + getDescriptor().getMessageTypes().get(155); internal_static_buf_validate_conformance_cases_SFixed32Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed32IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(155); + getDescriptor().getMessageTypes().get(156); internal_static_buf_validate_conformance_cases_SFixed32IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed32IncorrectType_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64None_descriptor = - getDescriptor().getMessageTypes().get(156); + getDescriptor().getMessageTypes().get(157); internal_static_buf_validate_conformance_cases_SFixed64None_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64None_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64Const_descriptor = - getDescriptor().getMessageTypes().get(157); + getDescriptor().getMessageTypes().get(158); internal_static_buf_validate_conformance_cases_SFixed64Const_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64Const_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64In_descriptor = - getDescriptor().getMessageTypes().get(158); + getDescriptor().getMessageTypes().get(159); internal_static_buf_validate_conformance_cases_SFixed64In_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64In_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64NotIn_descriptor = - getDescriptor().getMessageTypes().get(159); + getDescriptor().getMessageTypes().get(160); internal_static_buf_validate_conformance_cases_SFixed64NotIn_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64NotIn_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64LT_descriptor = - getDescriptor().getMessageTypes().get(160); + getDescriptor().getMessageTypes().get(161); internal_static_buf_validate_conformance_cases_SFixed64LT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64LT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64LTE_descriptor = - getDescriptor().getMessageTypes().get(161); + getDescriptor().getMessageTypes().get(162); internal_static_buf_validate_conformance_cases_SFixed64LTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64LTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64GT_descriptor = - getDescriptor().getMessageTypes().get(162); + getDescriptor().getMessageTypes().get(163); internal_static_buf_validate_conformance_cases_SFixed64GT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64GT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64GTE_descriptor = - getDescriptor().getMessageTypes().get(163); + getDescriptor().getMessageTypes().get(164); internal_static_buf_validate_conformance_cases_SFixed64GTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64GTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64GTLT_descriptor = - getDescriptor().getMessageTypes().get(164); + getDescriptor().getMessageTypes().get(165); internal_static_buf_validate_conformance_cases_SFixed64GTLT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64GTLT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64ExLTGT_descriptor = - getDescriptor().getMessageTypes().get(165); + getDescriptor().getMessageTypes().get(166); internal_static_buf_validate_conformance_cases_SFixed64ExLTGT_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64ExLTGT_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64GTELTE_descriptor = - getDescriptor().getMessageTypes().get(166); + getDescriptor().getMessageTypes().get(167); internal_static_buf_validate_conformance_cases_SFixed64GTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64GTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64ExGTELTE_descriptor = - getDescriptor().getMessageTypes().get(167); + getDescriptor().getMessageTypes().get(168); internal_static_buf_validate_conformance_cases_SFixed64ExGTELTE_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64ExGTELTE_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64Ignore_descriptor = - getDescriptor().getMessageTypes().get(168); + getDescriptor().getMessageTypes().get(169); internal_static_buf_validate_conformance_cases_SFixed64Ignore_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64Ignore_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_SFixed64IncorrectType_descriptor = - getDescriptor().getMessageTypes().get(169); + getDescriptor().getMessageTypes().get(170); internal_static_buf_validate_conformance_cases_SFixed64IncorrectType_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_SFixed64IncorrectType_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_Int64LTEOptional_descriptor = - getDescriptor().getMessageTypes().get(170); + getDescriptor().getMessageTypes().get(171); internal_static_buf_validate_conformance_cases_Int64LTEOptional_fieldAccessorTable = new com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_Int64LTEOptional_descriptor, diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreDefault.java new file mode 100644 index 00000000..cf70db3c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreDefault.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapIgnoreDefault} + */ +public final class Proto2MapIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MapIgnoreDefault) + Proto2MapIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MapIgnoreDefault.newBuilder() to construct. + private Proto2MapIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MapIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MapIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2MapIgnoreDefault.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MapIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MapIgnoreDefault other = (build.buf.validate.conformance.cases.Proto2MapIgnoreDefault) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MapIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MapIgnoreDefault) + build.buf.validate.conformance.cases.Proto2MapIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2MapIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MapIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MapIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto2MapIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2MapIgnoreDefault result = new build.buf.validate.conformance.cases.Proto2MapIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MapIgnoreDefault result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MapIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MapIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MapIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2MapIgnoreDefault.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MapIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MapIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto2MapIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MapIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2MapIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MapIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..0ec57514 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreDefaultOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MapIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MapIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreEmpty.java new file mode 100644 index 00000000..5d177e3f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreEmpty.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapIgnoreEmpty} + */ +public final class Proto2MapIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MapIgnoreEmpty) + Proto2MapIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MapIgnoreEmpty.newBuilder() to construct. + private Proto2MapIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MapIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MapIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MapIgnoreEmpty) + build.buf.validate.conformance.cases.Proto2MapIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MapIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MapIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MapIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..8763eefe --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreEmptyOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MapIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MapIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreUnspecified.java new file mode 100644 index 00000000..b9e5098a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreUnspecified.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapIgnoreUnspecified} + */ +public final class Proto2MapIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MapIgnoreUnspecified) + Proto2MapIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MapIgnoreUnspecified.newBuilder() to construct. + private Proto2MapIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MapIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MapIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MapIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MapIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MapIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MapIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..aca5dbba --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MapIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MapIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreDefault.java new file mode 100644 index 00000000..307217f0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreDefault.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault} + */ +public final class Proto2MapKeyIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault) + Proto2MapKeyIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MapKeyIgnoreDefault.newBuilder() to construct. + private Proto2MapKeyIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MapKeyIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MapKeyIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault other = (build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault) + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault result = new build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MapKeyIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..4bb81322 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreDefaultOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MapKeyIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MapKeyIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreEmpty.java new file mode 100644 index 00000000..de0aa9ae --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreEmpty.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty} + */ +public final class Proto2MapKeyIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty) + Proto2MapKeyIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MapKeyIgnoreEmpty.newBuilder() to construct. + private Proto2MapKeyIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MapKeyIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MapKeyIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty) + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MapKeyIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..2b0e7735 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreEmptyOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MapKeyIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MapKeyIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreUnspecified.java new file mode 100644 index 00000000..6923a6d8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreUnspecified.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified} + */ +public final class Proto2MapKeyIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified) + Proto2MapKeyIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MapKeyIgnoreUnspecified.newBuilder() to construct. + private Proto2MapKeyIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MapKeyIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MapKeyIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapKeyIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MapKeyIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..07d00c08 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapKeyIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MapKeyIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MapKeyIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreDefault.java new file mode 100644 index 00000000..1f7637e1 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreDefault.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapValueIgnoreDefault} + */ +public final class Proto2MapValueIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MapValueIgnoreDefault) + Proto2MapValueIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MapValueIgnoreDefault.newBuilder() to construct. + private Proto2MapValueIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MapValueIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MapValueIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault other = (build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapValueIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MapValueIgnoreDefault) + build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault result = new build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MapValueIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MapValueIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MapValueIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapValueIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..be462377 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreDefaultOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MapValueIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MapValueIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreEmpty.java new file mode 100644 index 00000000..5463ce96 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreEmpty.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty} + */ +public final class Proto2MapValueIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty) + Proto2MapValueIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MapValueIgnoreEmpty.newBuilder() to construct. + private Proto2MapValueIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MapValueIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MapValueIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty) + build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MapValueIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..040c1944 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreEmptyOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MapValueIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MapValueIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreUnspecified.java new file mode 100644 index 00000000..02db5f23 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreUnspecified.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified} + */ +public final class Proto2MapValueIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified) + Proto2MapValueIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MapValueIgnoreUnspecified.newBuilder() to construct. + private Proto2MapValueIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MapValueIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MapValueIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MapValueIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MapValueIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..8b83094c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MapValueIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MapValueIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MapValueIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreDefault.java new file mode 100644 index 00000000..26c17e93 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreDefault.java @@ -0,0 +1,1182 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault} + */ +public final class Proto2MessageOptionalIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault) + Proto2MessageOptionalIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MessageOptionalIgnoreDefault.newBuilder() to construct. + private Proto2MessageOptionalIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MessageOptionalIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MessageOptionalIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.class, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg other = (build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg) + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.class, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg build() { + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg buildPartial() { + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg result = new build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg other) { + if (other == build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.getDefaultInstance()) return this; + if (other.hasVal()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg) + private static final build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg(); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val_; + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.getDefaultInstance() : val_; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.getDefaultInstance() : val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVal()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getVal()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault other = (build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault) + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault result = new build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = valBuilder_ == null + ? val_ + : valBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val_; + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.MsgOrBuilder> valBuilder_; + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.getDefaultInstance() : val_; + } + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.MsgOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MessageOptionalIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..aecb6e4c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreDefaultOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MessageOptionalIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg getVal(); + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreDefault.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreEmpty.java new file mode 100644 index 00000000..5eef0dc1 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreEmpty.java @@ -0,0 +1,1182 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty} + */ +public final class Proto2MessageOptionalIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty) + Proto2MessageOptionalIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MessageOptionalIgnoreEmpty.newBuilder() to construct. + private Proto2MessageOptionalIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MessageOptionalIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MessageOptionalIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.class, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg other = (build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg) + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.class, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg build() { + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg buildPartial() { + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg result = new build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg other) { + if (other == build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.getDefaultInstance()) return this; + if (other.hasVal()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg) + private static final build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg(); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val_; + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.getDefaultInstance() : val_; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.getDefaultInstance() : val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVal()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getVal()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty) + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = valBuilder_ == null + ? val_ + : valBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val_; + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.MsgOrBuilder> valBuilder_; + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.getDefaultInstance() : val_; + } + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.MsgOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MessageOptionalIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..a838b604 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreEmptyOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MessageOptionalIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg getVal(); + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreEmpty.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreUnspecified.java new file mode 100644 index 00000000..6d575440 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreUnspecified.java @@ -0,0 +1,1182 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified} + */ +public final class Proto2MessageOptionalIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified) + Proto2MessageOptionalIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MessageOptionalIgnoreUnspecified.newBuilder() to construct. + private Proto2MessageOptionalIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MessageOptionalIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MessageOptionalIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.class, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg other = (build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg) + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.class, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg build() { + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg buildPartial() { + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg result = new build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg other) { + if (other == build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance()) return this; + if (other.hasVal()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg) + private static final build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg(); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val_; + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVal()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getVal()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageOptionalIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = valBuilder_ == null + ? val_ + : valBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val_; + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.MsgOrBuilder> valBuilder_; + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } + } + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.MsgOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MessageOptionalIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..fd59feae --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageOptionalIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MessageOptionalIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg getVal(); + /** + * optional .buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.Proto2MessageOptionalIgnoreUnspecified.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreDefault.java new file mode 100644 index 00000000..51429dbf --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreDefault.java @@ -0,0 +1,1189 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault} + */ +public final class Proto2MessageRequiredIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault) + Proto2MessageRequiredIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MessageRequiredIgnoreDefault.newBuilder() to construct. + private Proto2MessageRequiredIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MessageRequiredIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MessageRequiredIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.class, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg other = (build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg) + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.class, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg build() { + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg buildPartial() { + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg result = new build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg other) { + if (other == build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.getDefaultInstance()) return this; + if (other.hasVal()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg) + private static final build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg(); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val_; + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.getDefaultInstance() : val_; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.getDefaultInstance() : val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasVal()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVal()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getVal()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault other = (build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault) + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault result = new build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = valBuilder_ == null + ? val_ + : valBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasVal()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val_; + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.MsgOrBuilder> valBuilder_; + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.getDefaultInstance() : val_; + } + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.MsgOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MessageRequiredIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..d4e847df --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreDefaultOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MessageRequiredIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg getVal(); + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreDefault.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreEmpty.java new file mode 100644 index 00000000..b4ab5070 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreEmpty.java @@ -0,0 +1,1189 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty} + */ +public final class Proto2MessageRequiredIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty) + Proto2MessageRequiredIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MessageRequiredIgnoreEmpty.newBuilder() to construct. + private Proto2MessageRequiredIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MessageRequiredIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MessageRequiredIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.class, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg other = (build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg) + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.class, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg build() { + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg buildPartial() { + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg result = new build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg other) { + if (other == build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.getDefaultInstance()) return this; + if (other.hasVal()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg) + private static final build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg(); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val_; + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.getDefaultInstance() : val_; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.getDefaultInstance() : val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasVal()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVal()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getVal()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty) + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = valBuilder_ == null + ? val_ + : valBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasVal()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val_; + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.MsgOrBuilder> valBuilder_; + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.getDefaultInstance() : val_; + } + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.MsgOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MessageRequiredIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..b880e5c1 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreEmptyOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MessageRequiredIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg getVal(); + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreEmpty.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreUnspecified.java new file mode 100644 index 00000000..632292ba --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreUnspecified.java @@ -0,0 +1,1189 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified} + */ +public final class Proto2MessageRequiredIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified) + Proto2MessageRequiredIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2MessageRequiredIgnoreUnspecified.newBuilder() to construct. + private Proto2MessageRequiredIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2MessageRequiredIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2MessageRequiredIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.class, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg other = (build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg) + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.class, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg build() { + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg buildPartial() { + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg result = new build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg other) { + if (other == build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.getDefaultInstance()) return this; + if (other.hasVal()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readBytes(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg) + private static final build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg(); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val_; + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasVal()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVal()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getVal()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2MessageRequiredIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = valBuilder_ == null + ? val_ + : valBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasVal()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val_; + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.MsgOrBuilder> valBuilder_; + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } + } + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.MsgOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg.Builder, build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2MessageRequiredIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..8288c17a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2MessageRequiredIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2MessageRequiredIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg getVal(); + /** + * required .buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.Proto2MessageRequiredIgnoreUnspecified.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefault.java new file mode 100644 index 00000000..ef62a9ae --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefault.java @@ -0,0 +1,571 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2OneofIgnoreDefault} + */ +public final class Proto2OneofIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2OneofIgnoreDefault) + Proto2OneofIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2OneofIgnoreDefault.newBuilder() to construct. + private Proto2OneofIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2OneofIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2OneofIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault.Builder.class); + } + + private int oCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object o_; + public enum OCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VAL(1), + O_NOT_SET(0); + private final int value; + private OCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OCase valueOf(int value) { + return forNumber(value); + } + + public static OCase forNumber(int value) { + switch (value) { + case 1: return VAL; + case 0: return O_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public static final int VAL_FIELD_NUMBER = 1; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return 0; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (oCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) o_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (oCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 1, (int)((java.lang.Integer) o_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault other = (build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault) obj; + + if (!getOCase().equals(other.getOCase())) return false; + switch (oCase_) { + case 1: + if (getVal() + != other.getVal()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (oCase_) { + case 1: + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2OneofIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2OneofIgnoreDefault) + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + oCase_ = 0; + o_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault result = new build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault result) { + result.oCase_ = oCase_; + result.o_ = this.o_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault.getDefaultInstance()) return this; + switch (other.getOCase()) { + case VAL: { + setVal(other.getVal()); + break; + } + case O_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + o_ = input.readInt32(); + oCase_ = 1; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int oCase_ = 0; + private java.lang.Object o_; + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public Builder clearO() { + oCase_ = 0; + o_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return 0; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + oCase_ = 1; + o_ = value; + onChanged(); + return this; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + if (oCase_ == 1) { + oCase_ = 0; + o_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2OneofIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2OneofIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2OneofIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..8212e350 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefaultOrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2OneofIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2OneofIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); + + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefault.OCase getOCase(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefaultWithDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefaultWithDefault.java new file mode 100644 index 00000000..3a7b38b8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefaultWithDefault.java @@ -0,0 +1,571 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault} + */ +public final class Proto2OneofIgnoreDefaultWithDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault) + Proto2OneofIgnoreDefaultWithDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2OneofIgnoreDefaultWithDefault.newBuilder() to construct. + private Proto2OneofIgnoreDefaultWithDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2OneofIgnoreDefaultWithDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2OneofIgnoreDefaultWithDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefaultWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefaultWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault.class, build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault.Builder.class); + } + + private int oCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object o_; + public enum OCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VAL(1), + O_NOT_SET(0); + private final int value; + private OCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OCase valueOf(int value) { + return forNumber(value); + } + + public static OCase forNumber(int value) { + switch (value) { + case 1: return VAL; + case 0: return O_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public static final int VAL_FIELD_NUMBER = 1; + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return -42; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (oCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) o_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (oCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 1, (int)((java.lang.Integer) o_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault other = (build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault) obj; + + if (!getOCase().equals(other.getOCase())) return false; + switch (oCase_) { + case 1: + if (getVal() + != other.getVal()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (oCase_) { + case 1: + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault) + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefaultWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefaultWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault.class, build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + oCase_ = 0; + o_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreDefaultWithDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault build() { + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault result = new build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault result) { + result.oCase_ = oCase_; + result.o_ = this.o_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault.getDefaultInstance()) return this; + switch (other.getOCase()) { + case VAL: { + setVal(other.getVal()); + break; + } + case O_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + o_ = input.readInt32(); + oCase_ = 1; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int oCase_ = 0; + private java.lang.Object o_; + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public Builder clearO() { + oCase_ = 0; + o_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return -42; + } + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + oCase_ = 1; + o_ = value; + onChanged(); + return this; + } + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + if (oCase_ == 1) { + oCase_ = 0; + o_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault) + private static final build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2OneofIgnoreDefaultWithDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefaultWithDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefaultWithDefaultOrBuilder.java new file mode 100644 index 00000000..e52ea8a5 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreDefaultWithDefaultOrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2OneofIgnoreDefaultWithDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); + + build.buf.validate.conformance.cases.Proto2OneofIgnoreDefaultWithDefault.OCase getOCase(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmpty.java new file mode 100644 index 00000000..550498bb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmpty.java @@ -0,0 +1,571 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2OneofIgnoreEmpty} + */ +public final class Proto2OneofIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2OneofIgnoreEmpty) + Proto2OneofIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2OneofIgnoreEmpty.newBuilder() to construct. + private Proto2OneofIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2OneofIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2OneofIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty.Builder.class); + } + + private int oCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object o_; + public enum OCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VAL(1), + O_NOT_SET(0); + private final int value; + private OCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OCase valueOf(int value) { + return forNumber(value); + } + + public static OCase forNumber(int value) { + switch (value) { + case 1: return VAL; + case 0: return O_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public static final int VAL_FIELD_NUMBER = 1; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return 0; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (oCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) o_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (oCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 1, (int)((java.lang.Integer) o_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty) obj; + + if (!getOCase().equals(other.getOCase())) return false; + switch (oCase_) { + case 1: + if (getVal() + != other.getVal()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (oCase_) { + case 1: + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2OneofIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2OneofIgnoreEmpty) + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + oCase_ = 0; + o_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty result) { + result.oCase_ = oCase_; + result.o_ = this.o_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty.getDefaultInstance()) return this; + switch (other.getOCase()) { + case VAL: { + setVal(other.getVal()); + break; + } + case O_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + o_ = input.readInt32(); + oCase_ = 1; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int oCase_ = 0; + private java.lang.Object o_; + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public Builder clearO() { + oCase_ = 0; + o_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return 0; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + oCase_ = 1; + o_ = value; + onChanged(); + return this; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + if (oCase_ == 1) { + oCase_ = 0; + o_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2OneofIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2OneofIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2OneofIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..d1db2d9c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmptyOrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2OneofIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2OneofIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); + + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmpty.OCase getOCase(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmptyWithDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmptyWithDefault.java new file mode 100644 index 00000000..6c0cd222 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmptyWithDefault.java @@ -0,0 +1,571 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault} + */ +public final class Proto2OneofIgnoreEmptyWithDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault) + Proto2OneofIgnoreEmptyWithDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2OneofIgnoreEmptyWithDefault.newBuilder() to construct. + private Proto2OneofIgnoreEmptyWithDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2OneofIgnoreEmptyWithDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2OneofIgnoreEmptyWithDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmptyWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmptyWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault.class, build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault.Builder.class); + } + + private int oCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object o_; + public enum OCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VAL(1), + O_NOT_SET(0); + private final int value; + private OCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OCase valueOf(int value) { + return forNumber(value); + } + + public static OCase forNumber(int value) { + switch (value) { + case 1: return VAL; + case 0: return O_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public static final int VAL_FIELD_NUMBER = 1; + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return -42; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (oCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) o_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (oCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 1, (int)((java.lang.Integer) o_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault other = (build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault) obj; + + if (!getOCase().equals(other.getOCase())) return false; + switch (oCase_) { + case 1: + if (getVal() + != other.getVal()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (oCase_) { + case 1: + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault) + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmptyWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmptyWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault.class, build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + oCase_ = 0; + o_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreEmptyWithDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault build() { + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault result = new build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault result) { + result.oCase_ = oCase_; + result.o_ = this.o_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault.getDefaultInstance()) return this; + switch (other.getOCase()) { + case VAL: { + setVal(other.getVal()); + break; + } + case O_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + o_ = input.readInt32(); + oCase_ = 1; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int oCase_ = 0; + private java.lang.Object o_; + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public Builder clearO() { + oCase_ = 0; + o_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return -42; + } + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + oCase_ = 1; + o_ = value; + onChanged(); + return this; + } + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + if (oCase_ == 1) { + oCase_ = 0; + o_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault) + private static final build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2OneofIgnoreEmptyWithDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmptyWithDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmptyWithDefaultOrBuilder.java new file mode 100644 index 00000000..1da0c3e4 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreEmptyWithDefaultOrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2OneofIgnoreEmptyWithDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); + + build.buf.validate.conformance.cases.Proto2OneofIgnoreEmptyWithDefault.OCase getOCase(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecified.java new file mode 100644 index 00000000..12eea475 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecified.java @@ -0,0 +1,571 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified} + */ +public final class Proto2OneofIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified) + Proto2OneofIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2OneofIgnoreUnspecified.newBuilder() to construct. + private Proto2OneofIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2OneofIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2OneofIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified.Builder.class); + } + + private int oCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object o_; + public enum OCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VAL(1), + O_NOT_SET(0); + private final int value; + private OCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OCase valueOf(int value) { + return forNumber(value); + } + + public static OCase forNumber(int value) { + switch (value) { + case 1: return VAL; + case 0: return O_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public static final int VAL_FIELD_NUMBER = 1; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return 0; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (oCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) o_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (oCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 1, (int)((java.lang.Integer) o_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified) obj; + + if (!getOCase().equals(other.getOCase())) return false; + switch (oCase_) { + case 1: + if (getVal() + != other.getVal()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (oCase_) { + case 1: + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + oCase_ = 0; + o_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified result) { + result.oCase_ = oCase_; + result.o_ = this.o_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified.getDefaultInstance()) return this; + switch (other.getOCase()) { + case VAL: { + setVal(other.getVal()); + break; + } + case O_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + o_ = input.readInt32(); + oCase_ = 1; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int oCase_ = 0; + private java.lang.Object o_; + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public Builder clearO() { + oCase_ = 0; + o_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return 0; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + oCase_ = 1; + o_ = value; + onChanged(); + return this; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + if (oCase_ == 1) { + oCase_ = 0; + o_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2OneofIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..c5fefc3b --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2OneofIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); + + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecified.OCase getOCase(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecifiedWithDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecifiedWithDefault.java new file mode 100644 index 00000000..94897643 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecifiedWithDefault.java @@ -0,0 +1,571 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault} + */ +public final class Proto2OneofIgnoreUnspecifiedWithDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault) + Proto2OneofIgnoreUnspecifiedWithDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2OneofIgnoreUnspecifiedWithDefault.newBuilder() to construct. + private Proto2OneofIgnoreUnspecifiedWithDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2OneofIgnoreUnspecifiedWithDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2OneofIgnoreUnspecifiedWithDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecifiedWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecifiedWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault.class, build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault.Builder.class); + } + + private int oCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object o_; + public enum OCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VAL(1), + O_NOT_SET(0); + private final int value; + private OCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OCase valueOf(int value) { + return forNumber(value); + } + + public static OCase forNumber(int value) { + switch (value) { + case 1: return VAL; + case 0: return O_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public static final int VAL_FIELD_NUMBER = 1; + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return -42; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (oCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) o_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (oCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 1, (int)((java.lang.Integer) o_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault other = (build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault) obj; + + if (!getOCase().equals(other.getOCase())) return false; + switch (oCase_) { + case 1: + if (getVal() + != other.getVal()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (oCase_) { + case 1: + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault) + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecifiedWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecifiedWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault.class, build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + oCase_ = 0; + o_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2OneofIgnoreUnspecifiedWithDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault build() { + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault result = new build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault result) { + result.oCase_ = oCase_; + result.o_ = this.o_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault.getDefaultInstance()) return this; + switch (other.getOCase()) { + case VAL: { + setVal(other.getVal()); + break; + } + case O_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + o_ = input.readInt32(); + oCase_ = 1; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int oCase_ = 0; + private java.lang.Object o_; + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public Builder clearO() { + oCase_ = 0; + o_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return -42; + } + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + oCase_ = 1; + o_ = value; + onChanged(); + return this; + } + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + if (oCase_ == 1) { + oCase_ = 0; + o_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault) + private static final build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2OneofIgnoreUnspecifiedWithDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecifiedWithDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecifiedWithDefaultOrBuilder.java new file mode 100644 index 00000000..174bed90 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2OneofIgnoreUnspecifiedWithDefaultOrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2OneofIgnoreUnspecifiedWithDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); + + build.buf.validate.conformance.cases.Proto2OneofIgnoreUnspecifiedWithDefault.OCase getOCase(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreDefault.java new file mode 100644 index 00000000..fa1cc392 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreDefault.java @@ -0,0 +1,569 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault} + */ +public final class Proto2RepeatedIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault) + Proto2RepeatedIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2RepeatedIgnoreDefault.newBuilder() to construct. + private Proto2RepeatedIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2RepeatedIgnoreDefault() { + val_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2RepeatedIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList val_ = + emptyIntList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < val_.size(); i++) { + output.writeInt32(1, val_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(val_.getInt(i)); + } + size += dataSize; + size += 1 * getValList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault other = (build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault) obj; + + if (!getValList() + .equals(other.getValList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValCount() > 0) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getValList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault) + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault result = new build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureValIsMutable(); + val_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList val_ = emptyIntList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index to set the value at. + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + int index, int value) { + + ensureValIsMutable(); + val_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(int value) { + + ensureValIsMutable(); + val_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param values The val to add. + * @return This builder for chaining. + */ + public Builder addAllVal( + java.lang.Iterable values) { + ensureValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, val_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2RepeatedIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..e18e7d39 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreDefaultOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2RepeatedIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2RepeatedIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + int getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreEmpty.java new file mode 100644 index 00000000..4f455a16 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreEmpty.java @@ -0,0 +1,569 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty} + */ +public final class Proto2RepeatedIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty) + Proto2RepeatedIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2RepeatedIgnoreEmpty.newBuilder() to construct. + private Proto2RepeatedIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2RepeatedIgnoreEmpty() { + val_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2RepeatedIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList val_ = + emptyIntList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < val_.size(); i++) { + output.writeInt32(1, val_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(val_.getInt(i)); + } + size += dataSize; + size += 1 * getValList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty) obj; + + if (!getValList() + .equals(other.getValList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValCount() > 0) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getValList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty) + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureValIsMutable(); + val_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList val_ = emptyIntList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index to set the value at. + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + int index, int value) { + + ensureValIsMutable(); + val_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(int value) { + + ensureValIsMutable(); + val_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param values The val to add. + * @return This builder for chaining. + */ + public Builder addAllVal( + java.lang.Iterable values) { + ensureValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, val_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2RepeatedIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..38aaadc9 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreEmptyOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2RepeatedIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2RepeatedIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + int getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreUnspecified.java new file mode 100644 index 00000000..bb4ba28e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreUnspecified.java @@ -0,0 +1,569 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified} + */ +public final class Proto2RepeatedIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified) + Proto2RepeatedIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2RepeatedIgnoreUnspecified.newBuilder() to construct. + private Proto2RepeatedIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2RepeatedIgnoreUnspecified() { + val_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2RepeatedIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList val_ = + emptyIntList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < val_.size(); i++) { + output.writeInt32(1, val_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(val_.getInt(i)); + } + size += dataSize; + size += 1 * getValList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified) obj; + + if (!getValList() + .equals(other.getValList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValCount() > 0) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getValList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureValIsMutable(); + val_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList val_ = emptyIntList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index to set the value at. + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + int index, int value) { + + ensureValIsMutable(); + val_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(int value) { + + ensureValIsMutable(); + val_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param values The val to add. + * @return This builder for chaining. + */ + public Builder addAllVal( + java.lang.Iterable values) { + ensureValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, val_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2RepeatedIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..74341838 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2RepeatedIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2RepeatedIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + int getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreDefault.java new file mode 100644 index 00000000..d07cc9b4 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreDefault.java @@ -0,0 +1,569 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault} + */ +public final class Proto2RepeatedItemIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault) + Proto2RepeatedItemIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2RepeatedItemIgnoreDefault.newBuilder() to construct. + private Proto2RepeatedItemIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2RepeatedItemIgnoreDefault() { + val_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2RepeatedItemIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList val_ = + emptyIntList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < val_.size(); i++) { + output.writeInt32(1, val_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(val_.getInt(i)); + } + size += dataSize; + size += 1 * getValList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault other = (build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault) obj; + + if (!getValList() + .equals(other.getValList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValCount() > 0) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getValList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault) + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault result = new build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureValIsMutable(); + val_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList val_ = emptyIntList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index to set the value at. + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + int index, int value) { + + ensureValIsMutable(); + val_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(int value) { + + ensureValIsMutable(); + val_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param values The val to add. + * @return This builder for chaining. + */ + public Builder addAllVal( + java.lang.Iterable values) { + ensureValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, val_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2RepeatedItemIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..604a91b0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreDefaultOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2RepeatedItemIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + int getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreEmpty.java new file mode 100644 index 00000000..419d9060 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreEmpty.java @@ -0,0 +1,569 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty} + */ +public final class Proto2RepeatedItemIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty) + Proto2RepeatedItemIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2RepeatedItemIgnoreEmpty.newBuilder() to construct. + private Proto2RepeatedItemIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2RepeatedItemIgnoreEmpty() { + val_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2RepeatedItemIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList val_ = + emptyIntList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < val_.size(); i++) { + output.writeInt32(1, val_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(val_.getInt(i)); + } + size += dataSize; + size += 1 * getValList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty) obj; + + if (!getValList() + .equals(other.getValList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValCount() > 0) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getValList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty) + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureValIsMutable(); + val_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList val_ = emptyIntList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index to set the value at. + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + int index, int value) { + + ensureValIsMutable(); + val_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(int value) { + + ensureValIsMutable(); + val_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param values The val to add. + * @return This builder for chaining. + */ + public Builder addAllVal( + java.lang.Iterable values) { + ensureValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, val_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2RepeatedItemIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..57f18998 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreEmptyOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2RepeatedItemIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + int getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreUnspecified.java new file mode 100644 index 00000000..9c3780e0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreUnspecified.java @@ -0,0 +1,569 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified} + */ +public final class Proto2RepeatedItemIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified) + Proto2RepeatedItemIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2RepeatedItemIgnoreUnspecified.newBuilder() to construct. + private Proto2RepeatedItemIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2RepeatedItemIgnoreUnspecified() { + val_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2RepeatedItemIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList val_ = + emptyIntList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + for (int i = 0; i < val_.size(); i++) { + output.writeInt32(1, val_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(val_.getInt(i)); + } + size += dataSize; + size += 1 * getValList().size(); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified) obj; + + if (!getValList() + .equals(other.getValList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValCount() > 0) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getValList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2RepeatedItemIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureValIsMutable(); + val_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList val_ = emptyIntList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index to set the value at. + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + int index, int value) { + + ensureValIsMutable(); + val_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(int value) { + + ensureValIsMutable(); + val_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param values The val to add. + * @return This builder for chaining. + */ + public Builder addAllVal( + java.lang.Iterable values) { + ensureValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, val_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2RepeatedItemIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..64918a9d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2RepeatedItemIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2RepeatedItemIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2RepeatedItemIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + int getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefault.java new file mode 100644 index 00000000..e6f14da8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefault.java @@ -0,0 +1,496 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault} + */ +public final class Proto2ScalarOptionalIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault) + Proto2ScalarOptionalIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2ScalarOptionalIgnoreDefault.newBuilder() to construct. + private Proto2ScalarOptionalIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2ScalarOptionalIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2ScalarOptionalIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault other = (build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault) + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault result = new build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2ScalarOptionalIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..6a8df5e4 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefaultOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2ScalarOptionalIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefaultWithDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefaultWithDefault.java new file mode 100644 index 00000000..ba5d6d49 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefaultWithDefault.java @@ -0,0 +1,497 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault} + */ +public final class Proto2ScalarOptionalIgnoreDefaultWithDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault) + Proto2ScalarOptionalIgnoreDefaultWithDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2ScalarOptionalIgnoreDefaultWithDefault.newBuilder() to construct. + private Proto2ScalarOptionalIgnoreDefaultWithDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2ScalarOptionalIgnoreDefaultWithDefault() { + val_ = -42; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2ScalarOptionalIgnoreDefaultWithDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefaultWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefaultWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault.class, build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = -42; + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault other = (build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault) + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefaultWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefaultWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault.class, build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = -42; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreDefaultWithDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault build() { + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault result = new build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ = -42; + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = -42; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault) + private static final build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2ScalarOptionalIgnoreDefaultWithDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefaultWithDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefaultWithDefaultOrBuilder.java new file mode 100644 index 00000000..f57c0826 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreDefaultWithDefaultOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2ScalarOptionalIgnoreDefaultWithDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreDefaultWithDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmpty.java new file mode 100644 index 00000000..103dd983 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmpty.java @@ -0,0 +1,496 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty} + */ +public final class Proto2ScalarOptionalIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty) + Proto2ScalarOptionalIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2ScalarOptionalIgnoreEmpty.newBuilder() to construct. + private Proto2ScalarOptionalIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2ScalarOptionalIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2ScalarOptionalIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty) + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2ScalarOptionalIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..3b6f651d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmptyOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2ScalarOptionalIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmptyWithDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmptyWithDefault.java new file mode 100644 index 00000000..f6efeac6 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmptyWithDefault.java @@ -0,0 +1,497 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault} + */ +public final class Proto2ScalarOptionalIgnoreEmptyWithDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault) + Proto2ScalarOptionalIgnoreEmptyWithDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2ScalarOptionalIgnoreEmptyWithDefault.newBuilder() to construct. + private Proto2ScalarOptionalIgnoreEmptyWithDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2ScalarOptionalIgnoreEmptyWithDefault() { + val_ = -42; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2ScalarOptionalIgnoreEmptyWithDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmptyWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmptyWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault.class, build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = -42; + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault other = (build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault) + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmptyWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmptyWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault.class, build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = -42; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreEmptyWithDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault build() { + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault result = new build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ = -42; + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = -42; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault) + private static final build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2ScalarOptionalIgnoreEmptyWithDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmptyWithDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmptyWithDefaultOrBuilder.java new file mode 100644 index 00000000..aac291fd --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreEmptyWithDefaultOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2ScalarOptionalIgnoreEmptyWithDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreEmptyWithDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecified.java new file mode 100644 index 00000000..7435ddcc --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecified.java @@ -0,0 +1,496 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified} + */ +public final class Proto2ScalarOptionalIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified) + Proto2ScalarOptionalIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2ScalarOptionalIgnoreUnspecified.newBuilder() to construct. + private Proto2ScalarOptionalIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2ScalarOptionalIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2ScalarOptionalIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2ScalarOptionalIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..d792729c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2ScalarOptionalIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecifiedWithDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecifiedWithDefault.java new file mode 100644 index 00000000..0865b34c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecifiedWithDefault.java @@ -0,0 +1,497 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault} + */ +public final class Proto2ScalarOptionalIgnoreUnspecifiedWithDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault) + Proto2ScalarOptionalIgnoreUnspecifiedWithDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2ScalarOptionalIgnoreUnspecifiedWithDefault.newBuilder() to construct. + private Proto2ScalarOptionalIgnoreUnspecifiedWithDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2ScalarOptionalIgnoreUnspecifiedWithDefault() { + val_ = -42; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2ScalarOptionalIgnoreUnspecifiedWithDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecifiedWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecifiedWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault.class, build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = -42; + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault other = (build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault) + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecifiedWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecifiedWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault.class, build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = -42; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarOptionalIgnoreUnspecifiedWithDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault build() { + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault result = new build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ = -42; + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = -42; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault) + private static final build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2ScalarOptionalIgnoreUnspecifiedWithDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecifiedWithDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecifiedWithDefaultOrBuilder.java new file mode 100644 index 00000000..b8c87876 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarOptionalIgnoreUnspecifiedWithDefaultOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2ScalarOptionalIgnoreUnspecifiedWithDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2ScalarOptionalIgnoreUnspecifiedWithDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefault.java new file mode 100644 index 00000000..593b6366 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefault.java @@ -0,0 +1,503 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault} + */ +public final class Proto2ScalarRequiredIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault) + Proto2ScalarRequiredIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2ScalarRequiredIgnoreDefault.newBuilder() to construct. + private Proto2ScalarRequiredIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2ScalarRequiredIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2ScalarRequiredIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasVal()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault other = (build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault) + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault.class, build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault result = new build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasVal()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2ScalarRequiredIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..bc8310e6 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefaultOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2ScalarRequiredIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefaultWithDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefaultWithDefault.java new file mode 100644 index 00000000..78c2bc79 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefaultWithDefault.java @@ -0,0 +1,504 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault} + */ +public final class Proto2ScalarRequiredIgnoreDefaultWithDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault) + Proto2ScalarRequiredIgnoreDefaultWithDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2ScalarRequiredIgnoreDefaultWithDefault.newBuilder() to construct. + private Proto2ScalarRequiredIgnoreDefaultWithDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2ScalarRequiredIgnoreDefaultWithDefault() { + val_ = -42; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2ScalarRequiredIgnoreDefaultWithDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefaultWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefaultWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault.class, build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = -42; + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasVal()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault other = (build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault) + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefaultWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefaultWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault.class, build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = -42; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreDefaultWithDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault build() { + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault result = new build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasVal()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ = -42; + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = -42; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault) + private static final build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2ScalarRequiredIgnoreDefaultWithDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefaultWithDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefaultWithDefaultOrBuilder.java new file mode 100644 index 00000000..299e81c0 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreDefaultWithDefaultOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2ScalarRequiredIgnoreDefaultWithDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreDefaultWithDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmpty.java new file mode 100644 index 00000000..b4d10c89 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmpty.java @@ -0,0 +1,503 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty} + */ +public final class Proto2ScalarRequiredIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty) + Proto2ScalarRequiredIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2ScalarRequiredIgnoreEmpty.newBuilder() to construct. + private Proto2ScalarRequiredIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2ScalarRequiredIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2ScalarRequiredIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasVal()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty) + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasVal()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2ScalarRequiredIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..1465be8e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmptyOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2ScalarRequiredIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmptyWithDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmptyWithDefault.java new file mode 100644 index 00000000..88178608 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmptyWithDefault.java @@ -0,0 +1,504 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault} + */ +public final class Proto2ScalarRequiredIgnoreEmptyWithDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault) + Proto2ScalarRequiredIgnoreEmptyWithDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2ScalarRequiredIgnoreEmptyWithDefault.newBuilder() to construct. + private Proto2ScalarRequiredIgnoreEmptyWithDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2ScalarRequiredIgnoreEmptyWithDefault() { + val_ = -42; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2ScalarRequiredIgnoreEmptyWithDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmptyWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmptyWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault.class, build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = -42; + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasVal()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault other = (build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault) + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmptyWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmptyWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault.class, build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = -42; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreEmptyWithDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault build() { + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault result = new build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasVal()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ = -42; + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = -42; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault) + private static final build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2ScalarRequiredIgnoreEmptyWithDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmptyWithDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmptyWithDefaultOrBuilder.java new file mode 100644 index 00000000..dc734964 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreEmptyWithDefaultOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2ScalarRequiredIgnoreEmptyWithDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreEmptyWithDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecified.java new file mode 100644 index 00000000..559b043a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecified.java @@ -0,0 +1,503 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified} + */ +public final class Proto2ScalarRequiredIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified) + Proto2ScalarRequiredIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2ScalarRequiredIgnoreUnspecified.newBuilder() to construct. + private Proto2ScalarRequiredIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2ScalarRequiredIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2ScalarRequiredIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasVal()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasVal()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2ScalarRequiredIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..b73c3c9f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2ScalarRequiredIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * required int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecifiedWithDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecifiedWithDefault.java new file mode 100644 index 00000000..c07f9c1a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecifiedWithDefault.java @@ -0,0 +1,504 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault} + */ +public final class Proto2ScalarRequiredIgnoreUnspecifiedWithDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault) + Proto2ScalarRequiredIgnoreUnspecifiedWithDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto2ScalarRequiredIgnoreUnspecifiedWithDefault.newBuilder() to construct. + private Proto2ScalarRequiredIgnoreUnspecifiedWithDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto2ScalarRequiredIgnoreUnspecifiedWithDefault() { + val_ = -42; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto2ScalarRequiredIgnoreUnspecifiedWithDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecifiedWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecifiedWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault.class, build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = -42; + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + if (!hasVal()) { + memoizedIsInitialized = 0; + return false; + } + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault other = (build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault) + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecifiedWithDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecifiedWithDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault.class, build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = -42; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto2Proto.internal_static_buf_validate_conformance_cases_Proto2ScalarRequiredIgnoreUnspecifiedWithDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault build() { + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault buildPartial() { + build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault result = new build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault other) { + if (other == build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + if (!hasVal()) { + return false; + } + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ = -42; + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = -42; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault) + private static final build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault(); + } + + public static build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + @java.lang.Deprecated public static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto2ScalarRequiredIgnoreUnspecifiedWithDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecifiedWithDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecifiedWithDefaultOrBuilder.java new file mode 100644 index 00000000..d2b4ed8f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto2ScalarRequiredIgnoreUnspecifiedWithDefaultOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto2.proto + +package build.buf.validate.conformance.cases; + +public interface Proto2ScalarRequiredIgnoreUnspecifiedWithDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto2ScalarRequiredIgnoreUnspecifiedWithDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * required int32 val = 1 [default = -42, json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreDefault.java new file mode 100644 index 00000000..1f5d26f6 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreDefault.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapIgnoreDefault} + */ +public final class Proto3MapIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MapIgnoreDefault) + Proto3MapIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MapIgnoreDefault.newBuilder() to construct. + private Proto3MapIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MapIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MapIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3MapIgnoreDefault.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MapIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MapIgnoreDefault other = (build.buf.validate.conformance.cases.Proto3MapIgnoreDefault) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MapIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MapIgnoreDefault) + build.buf.validate.conformance.cases.Proto3MapIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3MapIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MapIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MapIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto3MapIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto3MapIgnoreDefault result = new build.buf.validate.conformance.cases.Proto3MapIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MapIgnoreDefault result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MapIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MapIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MapIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto3MapIgnoreDefault.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MapIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MapIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto3MapIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MapIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto3MapIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MapIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..462433f2 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreDefaultOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MapIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MapIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreEmpty.java new file mode 100644 index 00000000..903fbb79 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreEmpty.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapIgnoreEmpty} + */ +public final class Proto3MapIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MapIgnoreEmpty) + Proto3MapIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MapIgnoreEmpty.newBuilder() to construct. + private Proto3MapIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MapIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MapIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MapIgnoreEmpty) + build.buf.validate.conformance.cases.Proto3MapIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MapIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MapIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MapIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..bcb170e8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreEmptyOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MapIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MapIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreUnspecified.java new file mode 100644 index 00000000..4d5ae123 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreUnspecified.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapIgnoreUnspecified} + */ +public final class Proto3MapIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MapIgnoreUnspecified) + Proto3MapIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MapIgnoreUnspecified.newBuilder() to construct. + private Proto3MapIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MapIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MapIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MapIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MapIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MapIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MapIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..167d8478 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MapIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MapIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreDefault.java new file mode 100644 index 00000000..48395675 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreDefault.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault} + */ +public final class Proto3MapKeyIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault) + Proto3MapKeyIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MapKeyIgnoreDefault.newBuilder() to construct. + private Proto3MapKeyIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MapKeyIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MapKeyIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault other = (build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault) + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault result = new build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MapKeyIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..536f2f35 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreDefaultOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MapKeyIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MapKeyIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreEmpty.java new file mode 100644 index 00000000..16362d9a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreEmpty.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty} + */ +public final class Proto3MapKeyIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty) + Proto3MapKeyIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MapKeyIgnoreEmpty.newBuilder() to construct. + private Proto3MapKeyIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MapKeyIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MapKeyIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty) + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MapKeyIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..0a413ae8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreEmptyOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MapKeyIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MapKeyIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreUnspecified.java new file mode 100644 index 00000000..96cbace3 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreUnspecified.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified} + */ +public final class Proto3MapKeyIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified) + Proto3MapKeyIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MapKeyIgnoreUnspecified.newBuilder() to construct. + private Proto3MapKeyIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MapKeyIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MapKeyIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapKeyIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MapKeyIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..4690edeb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapKeyIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MapKeyIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MapKeyIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreDefault.java new file mode 100644 index 00000000..2fc31e1d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreDefault.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapValueIgnoreDefault} + */ +public final class Proto3MapValueIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MapValueIgnoreDefault) + Proto3MapValueIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MapValueIgnoreDefault.newBuilder() to construct. + private Proto3MapValueIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MapValueIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MapValueIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault other = (build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapValueIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MapValueIgnoreDefault) + build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault result = new build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MapValueIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MapValueIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MapValueIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapValueIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..2da0cfb7 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreDefaultOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MapValueIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MapValueIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreEmpty.java new file mode 100644 index 00000000..c1613b22 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreEmpty.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty} + */ +public final class Proto3MapValueIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty) + Proto3MapValueIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MapValueIgnoreEmpty.newBuilder() to construct. + private Proto3MapValueIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MapValueIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MapValueIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty) + build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MapValueIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..377a34ae --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreEmptyOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MapValueIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MapValueIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreUnspecified.java new file mode 100644 index 00000000..819110bb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreUnspecified.java @@ -0,0 +1,680 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified} + */ +public final class Proto3MapValueIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified) + Proto3MapValueIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MapValueIgnoreUnspecified.newBuilder() to construct. + private Proto3MapValueIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MapValueIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MapValueIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.Integer, java.lang.Integer> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.INT32, + 0, + com.google.protobuf.WireFormat.FieldType.INT32, + 0); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + com.google.protobuf.GeneratedMessageV3 + .serializeIntegerMapTo( + output, + internalGetVal(), + ValDefaultEntryHolder.defaultEntry, + 1); + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + for (java.util.Map.Entry entry + : internalGetVal().getMap().entrySet()) { + com.google.protobuf.MapEntry + val__ = ValDefaultEntryHolder.defaultEntry.newBuilderForType() + .setKey(entry.getKey()) + .setValue(entry.getValue()) + .build(); + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, val__); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified) obj; + + if (!internalGetVal().equals( + other.internalGetVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (!internalGetVal().getMap().isEmpty()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + internalGetVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMapField( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapField internalGetMutableMapField( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + internalGetMutableVal().clear(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MapValueIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified.getDefaultInstance()) return this; + internalGetMutableVal().mergeFrom( + other.internalGetVal()); + bitField0_ |= 0x00000001; + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + com.google.protobuf.MapEntry + val__ = input.readMessage( + ValDefaultEntryHolder.defaultEntry.getParserForType(), extensionRegistry); + internalGetMutableVal().getMutableMap().put( + val__.getKey(), val__.getValue()); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.MapField< + java.lang.Integer, java.lang.Integer> val_; + private com.google.protobuf.MapField + internalGetVal() { + if (val_ == null) { + return com.google.protobuf.MapField.emptyMapField( + ValDefaultEntryHolder.defaultEntry); + } + return val_; + } + private com.google.protobuf.MapField + internalGetMutableVal() { + if (val_ == null) { + val_ = com.google.protobuf.MapField.newMapField( + ValDefaultEntryHolder.defaultEntry); + } + if (!val_.isMutable()) { + val_ = val_.copy(); + } + bitField0_ |= 0x00000001; + onChanged(); + return val_; + } + public int getValCount() { + return internalGetVal().getMap().size(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + int key) { + + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrDefault( + int key, + int defaultValue) { + + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public int getValOrThrow( + int key) { + + java.util.Map map = + internalGetVal().getMap(); + if (!map.containsKey(key)) { + throw new java.lang.IllegalArgumentException(); + } + return map.get(key); + } + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + internalGetMutableVal().getMutableMap() + .clear(); + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + int key) { + + internalGetMutableVal().getMutableMap() + .remove(key); + return this; + } + /** + * Use alternate mutation accessors instead. + */ + @java.lang.Deprecated + public java.util.Map + getMutableVal() { + bitField0_ |= 0x00000001; + return internalGetMutableVal().getMutableMap(); + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + int key, + int value) { + + + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MapValueIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..6f443a56 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MapValueIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,41 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MapValueIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MapValueIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + int key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrDefault( + int key, + int defaultValue); + /** + * map<int32, int32> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValOrThrow( + int key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreDefault.java new file mode 100644 index 00000000..54d701f6 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreDefault.java @@ -0,0 +1,1179 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageIgnoreDefault} + */ +public final class Proto3MessageIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MessageIgnoreDefault) + Proto3MessageIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MessageIgnoreDefault.newBuilder() to construct. + private Proto3MessageIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MessageIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MessageIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.class, build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + val_ = s; + return s; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg other = (build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg) + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.class, build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg build() { + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg buildPartial() { + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg result = new build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg other) { + if (other == build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.getDefaultInstance()) return this; + if (other.hasVal()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + val_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg) + private static final build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg(); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val_; + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.getDefaultInstance() : val_; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.getDefaultInstance() : val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVal()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getVal()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault other = (build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MessageIgnoreDefault) + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault result = new build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = valBuilder_ == null + ? val_ + : valBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val_; + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg, build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.MsgOrBuilder> valBuilder_; + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.getDefaultInstance() : val_; + } + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg, build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.MsgOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg, build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MessageIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MessageIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MessageIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..7e05a94d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreDefaultOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MessageIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MessageIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg getVal(); + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.Proto3MessageIgnoreDefault.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreEmpty.java new file mode 100644 index 00000000..1b7b644b --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreEmpty.java @@ -0,0 +1,1179 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageIgnoreEmpty} + */ +public final class Proto3MessageIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MessageIgnoreEmpty) + Proto3MessageIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MessageIgnoreEmpty.newBuilder() to construct. + private Proto3MessageIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MessageIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MessageIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.class, build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + val_ = s; + return s; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg other = (build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg) + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.class, build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg build() { + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg buildPartial() { + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg result = new build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg other) { + if (other == build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.getDefaultInstance()) return this; + if (other.hasVal()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + val_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg) + private static final build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg(); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val_; + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.getDefaultInstance() : val_; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.getDefaultInstance() : val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVal()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getVal()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MessageIgnoreEmpty) + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = valBuilder_ == null + ? val_ + : valBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val_; + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg, build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.MsgOrBuilder> valBuilder_; + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.getDefaultInstance() : val_; + } + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg, build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.MsgOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg, build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MessageIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MessageIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MessageIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..36b6b5a1 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreEmptyOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MessageIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MessageIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg getVal(); + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.Proto3MessageIgnoreEmpty.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreUnspecified.java new file mode 100644 index 00000000..ad814fb4 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreUnspecified.java @@ -0,0 +1,1179 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified} + */ +public final class Proto3MessageIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified) + Proto3MessageIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MessageIgnoreUnspecified.newBuilder() to construct. + private Proto3MessageIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MessageIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MessageIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.class, build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + val_ = s; + return s; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg other = (build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg) + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.class, build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg build() { + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg buildPartial() { + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg result = new build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg other) { + if (other == build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.getDefaultInstance()) return this; + if (other.hasVal()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + val_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg) + private static final build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg(); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val_; + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVal()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getVal()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = valBuilder_ == null + ? val_ + : valBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val_; + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg, build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.MsgOrBuilder> valBuilder_; + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } + } + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg, build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.MsgOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg, build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MessageIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..f34bea98 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MessageIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg getVal(); + /** + * .buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.Proto3MessageIgnoreUnspecified.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreDefault.java new file mode 100644 index 00000000..2ef35301 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreDefault.java @@ -0,0 +1,1179 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault} + */ +public final class Proto3MessageOptionalIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault) + Proto3MessageOptionalIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MessageOptionalIgnoreDefault.newBuilder() to construct. + private Proto3MessageOptionalIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MessageOptionalIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MessageOptionalIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.class, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + val_ = s; + return s; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg other = (build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg) + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.class, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg build() { + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg buildPartial() { + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg result = new build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg other) { + if (other == build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.getDefaultInstance()) return this; + if (other.hasVal()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + val_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg) + private static final build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg(); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val_; + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.getDefaultInstance() : val_; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.getDefaultInstance() : val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVal()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getVal()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault other = (build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault) + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault result = new build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = valBuilder_ == null + ? val_ + : valBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val_; + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.MsgOrBuilder> valBuilder_; + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.getDefaultInstance() : val_; + } + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.MsgOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MessageOptionalIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..8c8f5470 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreDefaultOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MessageOptionalIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg getVal(); + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreDefault.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreEmpty.java new file mode 100644 index 00000000..74145979 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreEmpty.java @@ -0,0 +1,1179 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty} + */ +public final class Proto3MessageOptionalIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty) + Proto3MessageOptionalIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MessageOptionalIgnoreEmpty.newBuilder() to construct. + private Proto3MessageOptionalIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MessageOptionalIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MessageOptionalIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.class, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + val_ = s; + return s; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg other = (build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg) + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.class, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg build() { + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg buildPartial() { + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg result = new build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg other) { + if (other == build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.getDefaultInstance()) return this; + if (other.hasVal()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + val_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg) + private static final build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg(); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val_; + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.getDefaultInstance() : val_; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.getDefaultInstance() : val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVal()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getVal()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty) + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = valBuilder_ == null + ? val_ + : valBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val_; + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.MsgOrBuilder> valBuilder_; + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.getDefaultInstance() : val_; + } + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.MsgOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MessageOptionalIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..bae9d478 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreEmptyOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MessageOptionalIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg getVal(); + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreEmpty.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreUnspecified.java new file mode 100644 index 00000000..9785f779 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreUnspecified.java @@ -0,0 +1,1179 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified} + */ +public final class Proto3MessageOptionalIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified) + Proto3MessageOptionalIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3MessageOptionalIgnoreUnspecified.newBuilder() to construct. + private Proto3MessageOptionalIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3MessageOptionalIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3MessageOptionalIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Msg(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.class, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + val_ = s; + return s; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg other = (build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg) + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.class, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg build() { + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg buildPartial() { + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg result = new build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg other) { + if (other == build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance()) return this; + if (other.hasVal()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * optional string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + val_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [json_name = "val"]; + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg) + private static final build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg(); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Msg parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val_; + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeMessage(1, getVal()); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeMessageSize(1, getVal()); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (!getVal() + .equals(other.getVal())) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessageV3 + .alwaysUseFieldBuilders) { + getValFieldBuilder(); + } + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3MessageOptionalIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = valBuilder_ == null + ? val_ + : valBuilder_.build(); + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.getDefaultInstance()) return this; + if (other.hasVal()) { + mergeVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + input.readMessage( + getValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val_; + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.MsgOrBuilder> valBuilder_; + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg value) { + if (valBuilder_ == null) { + if (value == null) { + throw new NullPointerException(); + } + val_ = value; + } else { + valBuilder_.setMessage(value); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return getValFieldBuilder().getBuilder(); + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.getDefaultInstance() : val_; + } + } + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.MsgOrBuilder> + getValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilderV3< + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg.Builder, build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3MessageOptionalIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..dd2f5be7 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3MessageOptionalIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,24 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3MessageOptionalIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg getVal(); + /** + * optional .buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.Proto3MessageOptionalIgnoreUnspecified.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreDefault.java new file mode 100644 index 00000000..5ff4f068 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreDefault.java @@ -0,0 +1,571 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3OneofIgnoreDefault} + */ +public final class Proto3OneofIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3OneofIgnoreDefault) + Proto3OneofIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3OneofIgnoreDefault.newBuilder() to construct. + private Proto3OneofIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3OneofIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3OneofIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault.Builder.class); + } + + private int oCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object o_; + public enum OCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VAL(1), + O_NOT_SET(0); + private final int value; + private OCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OCase valueOf(int value) { + return forNumber(value); + } + + public static OCase forNumber(int value) { + switch (value) { + case 1: return VAL; + case 0: return O_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public static final int VAL_FIELD_NUMBER = 1; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return 0; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (oCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) o_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (oCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 1, (int)((java.lang.Integer) o_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault other = (build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault) obj; + + if (!getOCase().equals(other.getOCase())) return false; + switch (oCase_) { + case 1: + if (getVal() + != other.getVal()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (oCase_) { + case 1: + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3OneofIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3OneofIgnoreDefault) + build.buf.validate.conformance.cases.Proto3OneofIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + oCase_ = 0; + o_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault result = new build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault result) { + result.oCase_ = oCase_; + result.o_ = this.o_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault.getDefaultInstance()) return this; + switch (other.getOCase()) { + case VAL: { + setVal(other.getVal()); + break; + } + case O_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + o_ = input.readInt32(); + oCase_ = 1; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int oCase_ = 0; + private java.lang.Object o_; + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public Builder clearO() { + oCase_ = 0; + o_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return 0; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + oCase_ = 1; + o_ = value; + onChanged(); + return this; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + if (oCase_ == 1) { + oCase_ = 0; + o_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3OneofIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3OneofIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3OneofIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..207bf3ee --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreDefaultOrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3OneofIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3OneofIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); + + build.buf.validate.conformance.cases.Proto3OneofIgnoreDefault.OCase getOCase(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreEmpty.java new file mode 100644 index 00000000..a8602d16 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreEmpty.java @@ -0,0 +1,571 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3OneofIgnoreEmpty} + */ +public final class Proto3OneofIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3OneofIgnoreEmpty) + Proto3OneofIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3OneofIgnoreEmpty.newBuilder() to construct. + private Proto3OneofIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3OneofIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3OneofIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty.Builder.class); + } + + private int oCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object o_; + public enum OCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VAL(1), + O_NOT_SET(0); + private final int value; + private OCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OCase valueOf(int value) { + return forNumber(value); + } + + public static OCase forNumber(int value) { + switch (value) { + case 1: return VAL; + case 0: return O_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public static final int VAL_FIELD_NUMBER = 1; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return 0; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (oCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) o_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (oCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 1, (int)((java.lang.Integer) o_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty) obj; + + if (!getOCase().equals(other.getOCase())) return false; + switch (oCase_) { + case 1: + if (getVal() + != other.getVal()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (oCase_) { + case 1: + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3OneofIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3OneofIgnoreEmpty) + build.buf.validate.conformance.cases.Proto3OneofIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + oCase_ = 0; + o_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty result) { + result.oCase_ = oCase_; + result.o_ = this.o_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty.getDefaultInstance()) return this; + switch (other.getOCase()) { + case VAL: { + setVal(other.getVal()); + break; + } + case O_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + o_ = input.readInt32(); + oCase_ = 1; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int oCase_ = 0; + private java.lang.Object o_; + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public Builder clearO() { + oCase_ = 0; + o_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return 0; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + oCase_ = 1; + o_ = value; + onChanged(); + return this; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + if (oCase_ == 1) { + oCase_ = 0; + o_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3OneofIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3OneofIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3OneofIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..3499ce34 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreEmptyOrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3OneofIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3OneofIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); + + build.buf.validate.conformance.cases.Proto3OneofIgnoreEmpty.OCase getOCase(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreUnspecified.java new file mode 100644 index 00000000..12485cbb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreUnspecified.java @@ -0,0 +1,571 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified} + */ +public final class Proto3OneofIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified) + Proto3OneofIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3OneofIgnoreUnspecified.newBuilder() to construct. + private Proto3OneofIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3OneofIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3OneofIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified.Builder.class); + } + + private int oCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object o_; + public enum OCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + VAL(1), + O_NOT_SET(0); + private final int value; + private OCase(int value) { + this.value = value; + } + /** + * @param value The number of the enum to look for. + * @return The enum associated with the given number. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static OCase valueOf(int value) { + return forNumber(value); + } + + public static OCase forNumber(int value) { + switch (value) { + case 1: return VAL; + case 0: return O_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public static final int VAL_FIELD_NUMBER = 1; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return 0; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (oCase_ == 1) { + output.writeInt32( + 1, (int)((java.lang.Integer) o_)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (oCase_ == 1) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size( + 1, (int)((java.lang.Integer) o_)); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified) obj; + + if (!getOCase().equals(other.getOCase())) return false; + switch (oCase_) { + case 1: + if (getVal() + != other.getVal()) return false; + break; + case 0: + default: + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + switch (oCase_) { + case 1: + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + oCase_ = 0; + o_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3OneofIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified result) { + result.oCase_ = oCase_; + result.o_ = this.o_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified.getDefaultInstance()) return this; + switch (other.getOCase()) { + case VAL: { + setVal(other.getVal()); + break; + } + case O_NOT_SET: { + break; + } + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + o_ = input.readInt32(); + oCase_ = 1; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int oCase_ = 0; + private java.lang.Object o_; + public OCase + getOCase() { + return OCase.forNumber( + oCase_); + } + + public Builder clearO() { + oCase_ = 0; + o_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return oCase_ == 1; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public int getVal() { + if (oCase_ == 1) { + return (java.lang.Integer) o_; + } + return 0; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + oCase_ = 1; + o_ = value; + onChanged(); + return this; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + if (oCase_ == 1) { + oCase_ = 0; + o_ = null; + onChanged(); + } + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3OneofIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..524acefd --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3OneofIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,22 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3OneofIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); + + build.buf.validate.conformance.cases.Proto3OneofIgnoreUnspecified.OCase getOCase(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreDefault.java new file mode 100644 index 00000000..83579d12 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreDefault.java @@ -0,0 +1,580 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault} + */ +public final class Proto3RepeatedIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault) + Proto3RepeatedIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3RepeatedIgnoreDefault.newBuilder() to construct. + private Proto3RepeatedIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3RepeatedIgnoreDefault() { + val_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3RepeatedIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList val_ = + emptyIntList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + private int valMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getValList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valMemoizedSerializedSize); + } + for (int i = 0; i < val_.size(); i++) { + output.writeInt32NoTag(val_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(val_.getInt(i)); + } + size += dataSize; + if (!getValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault other = (build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault) obj; + + if (!getValList() + .equals(other.getValList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValCount() > 0) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getValList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault) + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault result = new build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureValIsMutable(); + val_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList val_ = emptyIntList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index to set the value at. + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + int index, int value) { + + ensureValIsMutable(); + val_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(int value) { + + ensureValIsMutable(); + val_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param values The val to add. + * @return This builder for chaining. + */ + public Builder addAllVal( + java.lang.Iterable values) { + ensureValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, val_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3RepeatedIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..a9bf38c8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreDefaultOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3RepeatedIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3RepeatedIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + int getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreEmpty.java new file mode 100644 index 00000000..bee8386b --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreEmpty.java @@ -0,0 +1,580 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty} + */ +public final class Proto3RepeatedIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty) + Proto3RepeatedIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3RepeatedIgnoreEmpty.newBuilder() to construct. + private Proto3RepeatedIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3RepeatedIgnoreEmpty() { + val_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3RepeatedIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList val_ = + emptyIntList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + private int valMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getValList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valMemoizedSerializedSize); + } + for (int i = 0; i < val_.size(); i++) { + output.writeInt32NoTag(val_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(val_.getInt(i)); + } + size += dataSize; + if (!getValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty) obj; + + if (!getValList() + .equals(other.getValList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValCount() > 0) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getValList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty) + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureValIsMutable(); + val_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList val_ = emptyIntList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index to set the value at. + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + int index, int value) { + + ensureValIsMutable(); + val_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(int value) { + + ensureValIsMutable(); + val_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param values The val to add. + * @return This builder for chaining. + */ + public Builder addAllVal( + java.lang.Iterable values) { + ensureValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, val_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3RepeatedIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..86a8d115 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreEmptyOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3RepeatedIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3RepeatedIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + int getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreUnspecified.java new file mode 100644 index 00000000..56cd4bbb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreUnspecified.java @@ -0,0 +1,580 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified} + */ +public final class Proto3RepeatedIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified) + Proto3RepeatedIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3RepeatedIgnoreUnspecified.newBuilder() to construct. + private Proto3RepeatedIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3RepeatedIgnoreUnspecified() { + val_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3RepeatedIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList val_ = + emptyIntList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + private int valMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getValList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valMemoizedSerializedSize); + } + for (int i = 0; i < val_.size(); i++) { + output.writeInt32NoTag(val_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(val_.getInt(i)); + } + size += dataSize; + if (!getValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified) obj; + + if (!getValList() + .equals(other.getValList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValCount() > 0) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getValList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureValIsMutable(); + val_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList val_ = emptyIntList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index to set the value at. + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + int index, int value) { + + ensureValIsMutable(); + val_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(int value) { + + ensureValIsMutable(); + val_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param values The val to add. + * @return This builder for chaining. + */ + public Builder addAllVal( + java.lang.Iterable values) { + ensureValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, val_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3RepeatedIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..9f9e89c8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3RepeatedIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3RepeatedIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + int getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreDefault.java new file mode 100644 index 00000000..db7f693c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreDefault.java @@ -0,0 +1,580 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault} + */ +public final class Proto3RepeatedItemIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault) + Proto3RepeatedItemIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3RepeatedItemIgnoreDefault.newBuilder() to construct. + private Proto3RepeatedItemIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3RepeatedItemIgnoreDefault() { + val_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3RepeatedItemIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList val_ = + emptyIntList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + private int valMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getValList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valMemoizedSerializedSize); + } + for (int i = 0; i < val_.size(); i++) { + output.writeInt32NoTag(val_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(val_.getInt(i)); + } + size += dataSize; + if (!getValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault other = (build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault) obj; + + if (!getValList() + .equals(other.getValList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValCount() > 0) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getValList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault) + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault result = new build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureValIsMutable(); + val_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList val_ = emptyIntList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index to set the value at. + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + int index, int value) { + + ensureValIsMutable(); + val_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(int value) { + + ensureValIsMutable(); + val_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param values The val to add. + * @return This builder for chaining. + */ + public Builder addAllVal( + java.lang.Iterable values) { + ensureValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, val_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3RepeatedItemIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..6f79f096 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreDefaultOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3RepeatedItemIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + int getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreEmpty.java new file mode 100644 index 00000000..db065ed6 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreEmpty.java @@ -0,0 +1,580 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty} + */ +public final class Proto3RepeatedItemIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty) + Proto3RepeatedItemIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3RepeatedItemIgnoreEmpty.newBuilder() to construct. + private Proto3RepeatedItemIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3RepeatedItemIgnoreEmpty() { + val_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3RepeatedItemIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList val_ = + emptyIntList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + private int valMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getValList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valMemoizedSerializedSize); + } + for (int i = 0; i < val_.size(); i++) { + output.writeInt32NoTag(val_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(val_.getInt(i)); + } + size += dataSize; + if (!getValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty) obj; + + if (!getValList() + .equals(other.getValList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValCount() > 0) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getValList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty) + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureValIsMutable(); + val_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList val_ = emptyIntList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index to set the value at. + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + int index, int value) { + + ensureValIsMutable(); + val_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(int value) { + + ensureValIsMutable(); + val_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param values The val to add. + * @return This builder for chaining. + */ + public Builder addAllVal( + java.lang.Iterable values) { + ensureValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, val_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3RepeatedItemIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..97c89a14 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreEmptyOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3RepeatedItemIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + int getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreUnspecified.java new file mode 100644 index 00000000..9f3cca3b --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreUnspecified.java @@ -0,0 +1,580 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified} + */ +public final class Proto3RepeatedItemIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified) + Proto3RepeatedItemIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3RepeatedItemIgnoreUnspecified.newBuilder() to construct. + private Proto3RepeatedItemIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3RepeatedItemIgnoreUnspecified() { + val_ = emptyIntList(); + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3RepeatedItemIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.Internal.IntList val_ = + emptyIntList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + @java.lang.Override + public java.util.List + getValList() { + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + private int valMemoizedSerializedSize = -1; + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + getSerializedSize(); + if (getValList().size() > 0) { + output.writeUInt32NoTag(10); + output.writeUInt32NoTag(valMemoizedSerializedSize); + } + for (int i = 0; i < val_.size(); i++) { + output.writeInt32NoTag(val_.getInt(i)); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + { + int dataSize = 0; + for (int i = 0; i < val_.size(); i++) { + dataSize += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(val_.getInt(i)); + } + size += dataSize; + if (!getValList().isEmpty()) { + size += 1; + size += com.google.protobuf.CodedOutputStream + .computeInt32SizeNoTag(dataSize); + } + valMemoizedSerializedSize = dataSize; + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified) obj; + + if (!getValList() + .equals(other.getValList())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (getValCount() > 0) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getValList().hashCode(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = emptyIntList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3RepeatedItemIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + val_.makeImmutable(); + bitField0_ |= 0x00000001; + } else { + ensureValIsMutable(); + val_.addAll(other.val_); + } + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + int v = input.readInt32(); + ensureValIsMutable(); + val_.addInt(v); + break; + } // case 8 + case 10: { + int length = input.readRawVarint32(); + int limit = input.pushLimit(length); + ensureValIsMutable(); + while (input.getBytesUntilLimit() > 0) { + val_.addInt(input.readInt32()); + } + input.popLimit(limit); + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private com.google.protobuf.Internal.IntList val_ = emptyIntList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = makeMutableCopy(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public java.util.List + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public int getVal(int index) { + return val_.getInt(index); + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index to set the value at. + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + int index, int value) { + + ensureValIsMutable(); + val_.setInt(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal(int value) { + + ensureValIsMutable(); + val_.addInt(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param values The val to add. + * @return This builder for chaining. + */ + public Builder addAllVal( + java.lang.Iterable values) { + ensureValIsMutable(); + com.google.protobuf.AbstractMessageLite.Builder.addAll( + values, val_); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = emptyIntList(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3RepeatedItemIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..b363b2f9 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3RepeatedItemIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3RepeatedItemIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3RepeatedItemIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List getValList(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + int getVal(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreDefault.java new file mode 100644 index 00000000..5198cd80 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreDefault.java @@ -0,0 +1,471 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3ScalarIgnoreDefault} + */ +public final class Proto3ScalarIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3ScalarIgnoreDefault) + Proto3ScalarIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3ScalarIgnoreDefault.newBuilder() to construct. + private Proto3ScalarIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3ScalarIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3ScalarIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault other = (build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3ScalarIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3ScalarIgnoreDefault) + build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault result = new build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3ScalarIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3ScalarIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3ScalarIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..c9d67786 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreDefaultOrBuilder.java @@ -0,0 +1,15 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3ScalarIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3ScalarIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreEmpty.java new file mode 100644 index 00000000..8f8d54ce --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreEmpty.java @@ -0,0 +1,471 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty} + */ +public final class Proto3ScalarIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty) + Proto3ScalarIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3ScalarIgnoreEmpty.newBuilder() to construct. + private Proto3ScalarIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3ScalarIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3ScalarIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty) + build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3ScalarIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..690c8da2 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreEmptyOrBuilder.java @@ -0,0 +1,15 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3ScalarIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3ScalarIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreUnspecified.java new file mode 100644 index 00000000..08fe472e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreUnspecified.java @@ -0,0 +1,471 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified} + */ +public final class Proto3ScalarIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified) + Proto3ScalarIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3ScalarIgnoreUnspecified.newBuilder() to construct. + private Proto3ScalarIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3ScalarIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3ScalarIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (val_ != 0) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (val_ != 0) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified) obj; + + if (getVal() + != other.getVal()) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified.getDefaultInstance()) return this; + if (other.getVal() != 0) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3ScalarIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..d18c254c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,15 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3ScalarIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3ScalarIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreDefault.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreDefault.java new file mode 100644 index 00000000..2bf996c5 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreDefault.java @@ -0,0 +1,496 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault} + */ +public final class Proto3ScalarOptionalIgnoreDefault extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault) + Proto3ScalarOptionalIgnoreDefaultOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3ScalarOptionalIgnoreDefault.newBuilder() to construct. + private Proto3ScalarOptionalIgnoreDefault(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3ScalarOptionalIgnoreDefault() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3ScalarOptionalIgnoreDefault(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault other = (build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault) + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefaultOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreDefault_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreDefault_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault.class, build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreDefault_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault build() { + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault buildPartial() { + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault result = new build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault other) { + if (other == build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault) + private static final build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault(); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3ScalarOptionalIgnoreDefault parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreDefaultOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreDefaultOrBuilder.java new file mode 100644 index 00000000..da950088 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreDefaultOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3ScalarOptionalIgnoreDefaultOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreDefault) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreEmpty.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreEmpty.java new file mode 100644 index 00000000..2937e2c4 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreEmpty.java @@ -0,0 +1,496 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty} + */ +public final class Proto3ScalarOptionalIgnoreEmpty extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty) + Proto3ScalarOptionalIgnoreEmptyOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3ScalarOptionalIgnoreEmpty.newBuilder() to construct. + private Proto3ScalarOptionalIgnoreEmpty(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3ScalarOptionalIgnoreEmpty() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3ScalarOptionalIgnoreEmpty(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty other = (build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty) + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmptyOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreEmpty_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreEmpty_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty.class, build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreEmpty_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty build() { + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty buildPartial() { + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty result = new build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty other) { + if (other == build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty) + private static final build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty(); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3ScalarOptionalIgnoreEmpty parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreEmptyOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreEmptyOrBuilder.java new file mode 100644 index 00000000..098d300c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreEmptyOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3ScalarOptionalIgnoreEmptyOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreEmpty) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreUnspecified.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreUnspecified.java new file mode 100644 index 00000000..9c2634c8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreUnspecified.java @@ -0,0 +1,496 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified} + */ +public final class Proto3ScalarOptionalIgnoreUnspecified extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified) + Proto3ScalarOptionalIgnoreUnspecifiedOrBuilder { +private static final long serialVersionUID = 0L; + // Use Proto3ScalarOptionalIgnoreUnspecified.newBuilder() to construct. + private Proto3ScalarOptionalIgnoreUnspecified(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private Proto3ScalarOptionalIgnoreUnspecified() { + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new Proto3ScalarOptionalIgnoreUnspecified(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private int val_ = 0; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (((bitField0_ & 0x00000001) != 0)) { + output.writeInt32(1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (((bitField0_ & 0x00000001) != 0)) { + size += com.google.protobuf.CodedOutputStream + .computeInt32Size(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified other = (build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified) obj; + + if (hasVal() != other.hasVal()) return false; + if (hasVal()) { + if (getVal() + != other.getVal()) return false; + } + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + if (hasVal()) { + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal(); + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified) + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecifiedOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreUnspecified_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreUnspecified_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified.class, build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = 0; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.IgnoreProto3Proto.internal_static_buf_validate_conformance_cases_Proto3ScalarOptionalIgnoreUnspecified_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified build() { + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified buildPartial() { + build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified result = new build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified result) { + int from_bitField0_ = bitField0_; + int to_bitField0_ = 0; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + to_bitField0_ |= 0x00000001; + } + result.bitField0_ |= to_bitField0_; + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified) { + return mergeFrom((build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified other) { + if (other == build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified.getDefaultInstance()) return this; + if (other.hasVal()) { + setVal(other.getVal()); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 8: { + val_ = input.readInt32(); + bitField0_ |= 0x00000001; + break; + } // case 8 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private int val_ ; + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public int getVal() { + return val_; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal(int value) { + + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = 0; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified) + private static final build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified(); + } + + public static build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public Proto3ScalarOptionalIgnoreUnspecified parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreUnspecifiedOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreUnspecifiedOrBuilder.java new file mode 100644 index 00000000..22bcde2d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/Proto3ScalarOptionalIgnoreUnspecifiedOrBuilder.java @@ -0,0 +1,20 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/ignore_proto3.proto + +package build.buf.validate.conformance.cases; + +public interface Proto3ScalarOptionalIgnoreUnspecifiedOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.Proto3ScalarOptionalIgnoreUnspecified) + com.google.protobuf.MessageOrBuilder { + + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional int32 val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + int getVal(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedProto.java index 78f9c7c4..a3fadc9f 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RepeatedProto.java @@ -173,7 +173,7 @@ public static void registerAllExtensions( "atedItemPattern\022-\n\003val\030\001 \003(\tB\033\272H\030\222\001\025\"\023r\021" + "2\017(?i)^[a-z0-9]+$R\003val\"Y\n\021RepeatedEmbedS" + "kip\022D\n\003val\030\001 \003(\0132%.buf.validate.conforma" + - "nce.cases.EmbedB\013\272H\010\222\001\005\"\003\300\001\001R\003val\"8\n\016Rep" + + "nce.cases.EmbedB\013\272H\010\222\001\005\"\003\330\001\003R\003val\"8\n\016Rep" + "eatedItemIn\022&\n\003val\030\001 \003(\tB\024\272H\021\222\001\016\"\014r\nR\003fo" + "oR\003barR\003val\";\n\021RepeatedItemNotIn\022&\n\003val\030" + "\001 \003(\tB\024\272H\021\222\001\016\"\014r\nZ\003fooZ\003barR\003val\"Z\n\016Repe" + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndOptionalPort.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndOptionalPort.java new file mode 100644 index 00000000..7ac263c1 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndOptionalPort.java @@ -0,0 +1,541 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/strings.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringHostAndOptionalPort} + */ +public final class StringHostAndOptionalPort extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringHostAndOptionalPort) + StringHostAndOptionalPortOrBuilder { +private static final long serialVersionUID = 0L; + // Use StringHostAndOptionalPort.newBuilder() to construct. + private StringHostAndOptionalPort(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StringHostAndOptionalPort() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StringHostAndOptionalPort(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringHostAndOptionalPort.class, build.buf.validate.conformance.cases.StringHostAndOptionalPort.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + val_ = s; + return s; + } + } + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(val_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(val_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.StringHostAndOptionalPort)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringHostAndOptionalPort other = (build.buf.validate.conformance.cases.StringHostAndOptionalPort) obj; + + if (!getVal() + .equals(other.getVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.StringHostAndOptionalPort prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.StringHostAndOptionalPort} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringHostAndOptionalPort) + build.buf.validate.conformance.cases.StringHostAndOptionalPortOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringHostAndOptionalPort.class, build.buf.validate.conformance.cases.StringHostAndOptionalPort.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringHostAndOptionalPort.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringHostAndOptionalPort getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringHostAndOptionalPort.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringHostAndOptionalPort build() { + build.buf.validate.conformance.cases.StringHostAndOptionalPort result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringHostAndOptionalPort buildPartial() { + build.buf.validate.conformance.cases.StringHostAndOptionalPort result = new build.buf.validate.conformance.cases.StringHostAndOptionalPort(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringHostAndOptionalPort result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.StringHostAndOptionalPort) { + return mergeFrom((build.buf.validate.conformance.cases.StringHostAndOptionalPort)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringHostAndOptionalPort other) { + if (other == build.buf.validate.conformance.cases.StringHostAndOptionalPort.getDefaultInstance()) return this; + if (!other.getVal().isEmpty()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + val_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.StringHostAndOptionalPort) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringHostAndOptionalPort) + private static final build.buf.validate.conformance.cases.StringHostAndOptionalPort DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringHostAndOptionalPort(); + } + + public static build.buf.validate.conformance.cases.StringHostAndOptionalPort getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringHostAndOptionalPort parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringHostAndOptionalPort getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndOptionalPortOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndOptionalPortOrBuilder.java new file mode 100644 index 00000000..d5a2c2cf --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndOptionalPortOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/strings.proto + +package build.buf.validate.conformance.cases; + +public interface StringHostAndOptionalPortOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringHostAndOptionalPort) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndPort.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndPort.java new file mode 100644 index 00000000..2baec582 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndPort.java @@ -0,0 +1,541 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/strings.proto + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.StringHostAndPort} + */ +public final class StringHostAndPort extends + com.google.protobuf.GeneratedMessageV3 implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.StringHostAndPort) + StringHostAndPortOrBuilder { +private static final long serialVersionUID = 0L; + // Use StringHostAndPort.newBuilder() to construct. + private StringHostAndPort(com.google.protobuf.GeneratedMessageV3.Builder builder) { + super(builder); + } + private StringHostAndPort() { + val_ = ""; + } + + @java.lang.Override + @SuppressWarnings({"unused"}) + protected java.lang.Object newInstance( + UnusedPrivateParameter unused) { + return new StringHostAndPort(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringHostAndPort_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringHostAndPort_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringHostAndPort.class, build.buf.validate.conformance.cases.StringHostAndPort.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public java.lang.String getVal() { + java.lang.Object ref = val_; + 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(); + val_ = s; + return s; + } + } + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + private byte memoizedIsInitialized = -1; + @java.lang.Override + public final boolean isInitialized() { + byte isInitialized = memoizedIsInitialized; + if (isInitialized == 1) return true; + if (isInitialized == 0) return false; + + memoizedIsInitialized = 1; + return true; + } + + @java.lang.Override + public void writeTo(com.google.protobuf.CodedOutputStream output) + throws java.io.IOException { + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(val_)) { + com.google.protobuf.GeneratedMessageV3.writeString(output, 1, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (!com.google.protobuf.GeneratedMessageV3.isStringEmpty(val_)) { + size += com.google.protobuf.GeneratedMessageV3.computeStringSize(1, val_); + } + size += getUnknownFields().getSerializedSize(); + memoizedSize = size; + return size; + } + + @java.lang.Override + public boolean equals(final java.lang.Object obj) { + if (obj == this) { + return true; + } + if (!(obj instanceof build.buf.validate.conformance.cases.StringHostAndPort)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.StringHostAndPort other = (build.buf.validate.conformance.cases.StringHostAndPort) obj; + + if (!getVal() + .equals(other.getVal())) return false; + if (!getUnknownFields().equals(other.getUnknownFields())) return false; + return true; + } + + @java.lang.Override + public int hashCode() { + if (memoizedHashCode != 0) { + return memoizedHashCode; + } + int hash = 41; + hash = (19 * hash) + getDescriptor().hashCode(); + hash = (37 * hash) + VAL_FIELD_NUMBER; + hash = (53 * hash) + getVal().hashCode(); + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.StringHostAndPort parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringHostAndPort parseFrom( + java.nio.ByteBuffer data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.StringHostAndPort parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringHostAndPort parseFrom( + com.google.protobuf.ByteString data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.StringHostAndPort parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.StringHostAndPort parseFrom( + byte[] data, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data, extensionRegistry); + } + public static build.buf.validate.conformance.cases.StringHostAndPort parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringHostAndPort parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.StringHostAndPort parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.StringHostAndPort parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.StringHostAndPort parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.StringHostAndPort parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessageV3 + .parseWithIOException(PARSER, input, extensionRegistry); + } + + @java.lang.Override + public Builder newBuilderForType() { return newBuilder(); } + public static Builder newBuilder() { + return DEFAULT_INSTANCE.toBuilder(); + } + public static Builder newBuilder(build.buf.validate.conformance.cases.StringHostAndPort prototype) { + return DEFAULT_INSTANCE.toBuilder().mergeFrom(prototype); + } + @java.lang.Override + public Builder toBuilder() { + return this == DEFAULT_INSTANCE + ? new Builder() : new Builder().mergeFrom(this); + } + + @java.lang.Override + protected Builder newBuilderForType( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.StringHostAndPort} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessageV3.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.StringHostAndPort) + build.buf.validate.conformance.cases.StringHostAndPortOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringHostAndPort_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringHostAndPort_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.StringHostAndPort.class, build.buf.validate.conformance.cases.StringHostAndPort.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.StringHostAndPort.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessageV3.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = ""; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.StringsProto.internal_static_buf_validate_conformance_cases_StringHostAndPort_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringHostAndPort getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.StringHostAndPort.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringHostAndPort build() { + build.buf.validate.conformance.cases.StringHostAndPort result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringHostAndPort buildPartial() { + build.buf.validate.conformance.cases.StringHostAndPort result = new build.buf.validate.conformance.cases.StringHostAndPort(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.StringHostAndPort result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + } + } + + @java.lang.Override + public Builder clone() { + return super.clone(); + } + @java.lang.Override + public Builder setField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.setField(field, value); + } + @java.lang.Override + public Builder clearField( + com.google.protobuf.Descriptors.FieldDescriptor field) { + return super.clearField(field); + } + @java.lang.Override + public Builder clearOneof( + com.google.protobuf.Descriptors.OneofDescriptor oneof) { + return super.clearOneof(oneof); + } + @java.lang.Override + public Builder setRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + int index, java.lang.Object value) { + return super.setRepeatedField(field, index, value); + } + @java.lang.Override + public Builder addRepeatedField( + com.google.protobuf.Descriptors.FieldDescriptor field, + java.lang.Object value) { + return super.addRepeatedField(field, value); + } + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.StringHostAndPort) { + return mergeFrom((build.buf.validate.conformance.cases.StringHostAndPort)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.StringHostAndPort other) { + if (other == build.buf.validate.conformance.cases.StringHostAndPort.getDefaultInstance()) return this; + if (!other.getVal().isEmpty()) { + val_ = other.val_; + bitField0_ |= 0x00000001; + onChanged(); + } + this.mergeUnknownFields(other.getUnknownFields()); + onChanged(); + return this; + } + + @java.lang.Override + public final boolean isInitialized() { + return true; + } + + @java.lang.Override + public Builder mergeFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + if (extensionRegistry == null) { + throw new java.lang.NullPointerException(); + } + try { + boolean done = false; + while (!done) { + int tag = input.readTag(); + switch (tag) { + case 0: + done = true; + break; + case 10: { + val_ = input.readStringRequireUtf8(); + bitField0_ |= 0x00000001; + break; + } // case 10 + default: { + if (!super.parseUnknownField(input, extensionRegistry, tag)) { + done = true; // was an endgroup tag + } + break; + } // default: + } // switch (tag) + } // while (!done) + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.unwrapIOException(); + } finally { + onChanged(); + } // finally + return this; + } + private int bitField0_; + + private java.lang.Object val_ = ""; + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public java.lang.String getVal() { + java.lang.Object ref = val_; + if (!(ref instanceof java.lang.String)) { + com.google.protobuf.ByteString bs = + (com.google.protobuf.ByteString) ref; + java.lang.String s = bs.toStringUtf8(); + val_ = s; + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + public com.google.protobuf.ByteString + getValBytes() { + java.lang.Object ref = val_; + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + val_ = b; + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to set. + * @return This builder for chaining. + */ + public Builder setVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The bytes for val to set. + * @return This builder for chaining. + */ + public Builder setValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + @java.lang.Override + public final Builder setUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.setUnknownFields(unknownFields); + } + + @java.lang.Override + public final Builder mergeUnknownFields( + final com.google.protobuf.UnknownFieldSet unknownFields) { + return super.mergeUnknownFields(unknownFields); + } + + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.StringHostAndPort) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.StringHostAndPort) + private static final build.buf.validate.conformance.cases.StringHostAndPort DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.StringHostAndPort(); + } + + public static build.buf.validate.conformance.cases.StringHostAndPort getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public StringHostAndPort parsePartialFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws com.google.protobuf.InvalidProtocolBufferException { + Builder builder = newBuilder(); + try { + builder.mergeFrom(input, extensionRegistry); + } catch (com.google.protobuf.InvalidProtocolBufferException e) { + throw e.setUnfinishedMessage(builder.buildPartial()); + } catch (com.google.protobuf.UninitializedMessageException e) { + throw e.asInvalidProtocolBufferException().setUnfinishedMessage(builder.buildPartial()); + } catch (java.io.IOException e) { + throw new com.google.protobuf.InvalidProtocolBufferException(e) + .setUnfinishedMessage(builder.buildPartial()); + } + return builder.buildPartial(); + } + }; + + public static com.google.protobuf.Parser parser() { + return PARSER; + } + + @java.lang.Override + public com.google.protobuf.Parser getParserForType() { + return PARSER; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.StringHostAndPort getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndPortOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndPortOrBuilder.java new file mode 100644 index 00000000..fa689ce7 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringHostAndPortOrBuilder.java @@ -0,0 +1,21 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/conformance/cases/strings.proto + +package build.buf.validate.conformance.cases; + +public interface StringHostAndPortOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.StringHostAndPort) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/StringsProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/StringsProto.java index a263a6f1..9c9ff29b 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/StringsProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/StringsProto.java @@ -219,6 +219,16 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessageV3.FieldAccessorTable internal_static_buf_validate_conformance_cases_StringInOneof_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringHostAndPort_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringHostAndPort_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_descriptor; + static final + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable + internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -280,12 +290,17 @@ public static void registerAllExtensions( "\010r\006\300\001\002\310\001\000R\003val\"1\n\020StringUUIDIgnore\022\035\n\003va" + "l\030\001 \001(\tB\013\272H\010r\003\260\001\001\320\001\001R\003val\"7\n\rStringInOne" + "of\022\037\n\003bar\030\001 \001(\tB\013\272H\010r\006R\001aR\001bH\000R\003barB\005\n\003f" + - "ooB\320\001\n$build.buf.validate.conformance.ca" + - "sesB\014StringsProtoP\001\242\002\004BVCC\252\002\036Buf.Validat" + - "e.Conformance.Cases\312\002\036Buf\\Validate\\Confo" + - "rmance\\Cases\342\002*Buf\\Validate\\Conformance\\" + - "Cases\\GPBMetadata\352\002!Buf::Validate::Confo" + - "rmance::Casesb\006proto3" + "oo\"/\n\021StringHostAndPort\022\032\n\003val\030\001 \001(\tB\010\272H" + + "\005r\003\200\002\001R\003val\"\244\001\n\031StringHostAndOptionalPor" + + "t\022\206\001\n\003val\030\001 \001(\tBt\272Hq\272\001n\n\"string.host_and" + + "_port.optional_port\022-value must be a hos" + + "t and (optional) port pair\032\031this.isHostA" + + "ndPort(false)R\003valB\320\001\n$build.buf.validat" + + "e.conformance.casesB\014StringsProtoP\001\242\002\004BV" + + "CC\252\002\036Buf.Validate.Conformance.Cases\312\002\036Bu" + + "f\\Validate\\Conformance\\Cases\342\002*Buf\\Valid" + + "ate\\Conformance\\Cases\\GPBMetadata\352\002!Buf:" + + ":Validate::Conformance::Casesb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -538,6 +553,18 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( internal_static_buf_validate_conformance_cases_StringInOneof_descriptor, new java.lang.String[] { "Bar", "Foo", }); + internal_static_buf_validate_conformance_cases_StringHostAndPort_descriptor = + getDescriptor().getMessageTypes().get(41); + internal_static_buf_validate_conformance_cases_StringHostAndPort_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringHostAndPort_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_descriptor = + getDescriptor().getMessageTypes().get(42); + internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_fieldAccessorTable = new + com.google.protobuf.GeneratedMessageV3.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_StringHostAndOptionalPort_descriptor, + new java.lang.String[] { "Val", }); com.google.protobuf.ExtensionRegistry registry = com.google.protobuf.ExtensionRegistry.newInstance(); registry.add(build.buf.validate.ValidateProto.field); diff --git a/gradle.properties b/gradle.properties index ded1fd2a..1b47fff5 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # When updating, also update src/test/resources/proto/buf.yaml and re-run 'buf mod update'. -protovalidate.version = v0.5.3 +protovalidate.version = v0.6.1 # Arguments to the protovalidate-conformance CLI protovalidate.conformance.args = --strict_message --strict_error diff --git a/src/main/java/build/buf/protovalidate/exceptions/CompilationException.java b/src/main/java/build/buf/protovalidate/exceptions/CompilationException.java index 8e2c2806..559dc597 100644 --- a/src/main/java/build/buf/protovalidate/exceptions/CompilationException.java +++ b/src/main/java/build/buf/protovalidate/exceptions/CompilationException.java @@ -16,10 +16,21 @@ /** CompilationException is returned when a constraint fails to compile. This is a fatal error. */ public class CompilationException extends ValidationException { + /** + * Creates a CompilationException with the specified message. + * + * @param message Exception message. + */ public CompilationException(String message) { super(message); } + /** + * Creates a CompilationException with the specified message and cause. + * + * @param message Exception message. + * @param cause Underlying cause of the exception. + */ public CompilationException(String message, Throwable cause) { super(message, cause); } diff --git a/src/main/java/build/buf/protovalidate/exceptions/ExecutionException.java b/src/main/java/build/buf/protovalidate/exceptions/ExecutionException.java index 1d455d90..3c0971df 100644 --- a/src/main/java/build/buf/protovalidate/exceptions/ExecutionException.java +++ b/src/main/java/build/buf/protovalidate/exceptions/ExecutionException.java @@ -16,6 +16,11 @@ /** ExecutionException is returned when a constraint fails to execute. This is a fatal error. */ public class ExecutionException extends ValidationException { + /** + * Creates an ExecutionException with the specified message. + * + * @param message Exception message. + */ public ExecutionException(String message) { super(message); } diff --git a/src/main/java/build/buf/protovalidate/exceptions/ValidationException.java b/src/main/java/build/buf/protovalidate/exceptions/ValidationException.java index f4c5dc92..5d888579 100644 --- a/src/main/java/build/buf/protovalidate/exceptions/ValidationException.java +++ b/src/main/java/build/buf/protovalidate/exceptions/ValidationException.java @@ -16,10 +16,21 @@ /** ValidationException is the base exception for all validation errors. */ public class ValidationException extends Exception { + /** + * Creates a ValidationException with the specified message. + * + * @param message Exception message. + */ public ValidationException(String message) { super(message); } + /** + * Creates a ValidationException with the specified message and cause. + * + * @param message Exception message. + * @param cause Underlying cause of the exception. + */ public ValidationException(String message, Throwable cause) { super(message, cause); } diff --git a/src/main/java/build/buf/protovalidate/internal/celext/CustomDeclarations.java b/src/main/java/build/buf/protovalidate/internal/celext/CustomDeclarations.java index f6f28114..3ef359d2 100644 --- a/src/main/java/build/buf/protovalidate/internal/celext/CustomDeclarations.java +++ b/src/main/java/build/buf/protovalidate/internal/celext/CustomDeclarations.java @@ -89,6 +89,14 @@ static List create() { Decls.newInstanceOverload( "is_hostname", Collections.singletonList(Decls.String), Decls.Bool))); + decls.add( + Decls.newFunction( + "isHostAndPort", + Decls.newInstanceOverload( + "string_bool_is_host_and_port_bool", + Arrays.asList(Decls.String, Decls.Bool), + Decls.Bool))); + // Add 'startsWith' function declaration decls.add( Decls.newFunction( diff --git a/src/main/java/build/buf/protovalidate/internal/celext/CustomOverload.java b/src/main/java/build/buf/protovalidate/internal/celext/CustomOverload.java index 94469f87..bff5670c 100644 --- a/src/main/java/build/buf/protovalidate/internal/celext/CustomOverload.java +++ b/src/main/java/build/buf/protovalidate/internal/celext/CustomOverload.java @@ -57,6 +57,7 @@ final class CustomOverload { private static final String OVERLOAD_IS_URI_REF = "isUriRef"; private static final String OVERLOAD_IS_NAN = "isNan"; private static final String OVERLOAD_IS_INF = "isInf"; + private static final String OVERLOAD_IS_HOST_AND_PORT = "isHostAndPort"; /** * Create custom function overload list. @@ -78,6 +79,7 @@ static Overload[] create() { isUriRef(), isNan(), isInf(), + isHostAndPort(), }; } @@ -438,6 +440,55 @@ private static Overload isInf() { null); } + private static Overload isHostAndPort() { + return Overload.overload( + OVERLOAD_IS_HOST_AND_PORT, + null, + null, + (lhs, rhs) -> { + if (lhs.type().typeEnum() != TypeEnum.String || rhs.type().typeEnum() != TypeEnum.Bool) { + return Err.noSuchOverload(lhs, OVERLOAD_IS_HOST_AND_PORT, rhs); + } + String value = (String) lhs.value(); + boolean portRequired = rhs.booleanValue(); + return Types.boolOf(hostAndPort(value, portRequired)); + }, + null); + } + + private static boolean hostAndPort(String value, boolean portRequired) { + if (value.isEmpty()) { + return false; + } + int splitIdx = value.lastIndexOf(':'); + if (value.charAt(0) == '[') { // ipv6 + int end = value.indexOf(']'); + if (end + 1 == value.length()) { // no port + return !portRequired && validateIP(value.substring(1, end), 6); + } + if (end + 1 == splitIdx) { // port + return validateIP(value.substring(1, end), 6) + && validatePort(value.substring(splitIdx + 1)); + } + return false; // malformed + } + if (splitIdx < 0) { + return !portRequired && (validateHostname(value) || validateIP(value, 4)); + } + String host = value.substring(0, splitIdx); + String port = value.substring(splitIdx + 1); + return (validateHostname(host) || validateIP(host, 4)) && validatePort(port); + } + + private static boolean validatePort(String value) { + try { + int portNum = Integer.parseInt(value); + return portNum >= 0 && portNum <= 65535; + } catch (NumberFormatException nfe) { + return false; + } + } + /** * Determines if the input list contains unique values. If the list contains duplicate values, it * returns {@link BoolT#False}. If the list contains unique values, it returns {@link BoolT#True}. @@ -484,7 +535,7 @@ private static boolean validateEmail(String addr) { try { InternetAddress emailAddr = new InternetAddress(addr); emailAddr.validate(); - if (addr.contains("<")) { + if (addr.contains("<") || !emailAddr.getAddress().equals(addr)) { return false; } addr = emailAddr.getAddress(); @@ -510,19 +561,27 @@ private static boolean validateHostname(String host) { } String s = Ascii.toLowerCase(host.endsWith(".") ? host.substring(0, host.length() - 1) : host); Iterable parts = Splitter.on('.').split(s); + boolean allDigits = false; for (String part : parts) { + allDigits = true; int l = part.length(); if (l == 0 || l > 63 || part.charAt(0) == '-' || part.charAt(l - 1) == '-') { return false; } for (int i = 0; i < l; i++) { char ch = part.charAt(i); - if ((ch < 'a' || ch > 'z') && (ch < '0' || ch > '9') && ch != '-') { + if (!Ascii.isLowerCase(ch) && !isDigit(ch) && ch != '-') { return false; } + allDigits = allDigits && isDigit(ch); } } - return true; + // the last part cannot be all numbers + return !allDigits; + } + + private static boolean isDigit(char c) { + return c >= '0' && c <= '9'; } /** diff --git a/src/main/java/build/buf/protovalidate/internal/celext/ValidateLibrary.java b/src/main/java/build/buf/protovalidate/internal/celext/ValidateLibrary.java index ffa0110e..69ca3f72 100644 --- a/src/main/java/build/buf/protovalidate/internal/celext/ValidateLibrary.java +++ b/src/main/java/build/buf/protovalidate/internal/celext/ValidateLibrary.java @@ -29,6 +29,9 @@ */ public class ValidateLibrary implements Library { + /** Creates a ValidateLibrary with all custom declarations and overloads. */ + public ValidateLibrary() {} + /** * Returns the compile options for the CEL environment. * diff --git a/src/main/java/build/buf/protovalidate/internal/constraints/ConstraintCache.java b/src/main/java/build/buf/protovalidate/internal/constraints/ConstraintCache.java index ecbe458a..67f43aa0 100644 --- a/src/main/java/build/buf/protovalidate/internal/constraints/ConstraintCache.java +++ b/src/main/java/build/buf/protovalidate/internal/constraints/ConstraintCache.java @@ -59,7 +59,11 @@ public class ConstraintCache { /** The environment to use for evaluation. */ private final Env env; - /** Constructs a new build-through cache for the standard constraints. */ + /** + * Constructs a new build-through cache for the standard constraints. + * + * @param env The CEL environment for evaluation. + */ public ConstraintCache(Env env) { this.env = env; } diff --git a/src/main/java/build/buf/protovalidate/internal/constraints/DescriptorMappings.java b/src/main/java/build/buf/protovalidate/internal/constraints/DescriptorMappings.java index 140def37..528bc25a 100644 --- a/src/main/java/build/buf/protovalidate/internal/constraints/DescriptorMappings.java +++ b/src/main/java/build/buf/protovalidate/internal/constraints/DescriptorMappings.java @@ -27,7 +27,7 @@ /** * DescriptorMappings provides mappings between protocol buffer descriptors and CEL declarations. */ -public class DescriptorMappings { +public final class DescriptorMappings { /** Provides a {@link Descriptor} for {@link FieldConstraints}. */ static final Descriptor FIELD_CONSTRAINTS_DESC = FieldConstraints.getDescriptor(); @@ -96,9 +96,14 @@ public class DescriptorMappings { "google.protobuf.Timestamp", FIELD_CONSTRAINTS_DESC.findFieldByName("timestamp")); } + private DescriptorMappings() {} + /** * Returns the {@link FieldConstraints} field that is expected for the given protocol buffer field * kind. + * + * @param fqn Fully qualified name of protobuf value wrapper. + * @return The constraints field descriptor for the specified wrapper fully qualified name. */ @Nullable public static FieldDescriptor expectedWrapperConstraints(String fqn) { @@ -128,6 +133,9 @@ public static FieldDescriptor expectedWrapperConstraints(String fqn) { /** * Maps a {@link FieldDescriptor.Type} to a compatible {@link com.google.api.expr.v1alpha1.Type}. + * + * @param kind The protobuf field type. + * @return The corresponding CEL type for the protobuf field. */ public static Type protoKindToCELType(FieldDescriptor.Type kind) { switch (kind) { diff --git a/src/main/java/build/buf/protovalidate/internal/evaluator/Evaluator.java b/src/main/java/build/buf/protovalidate/internal/evaluator/Evaluator.java index 56ff618b..31e310fa 100644 --- a/src/main/java/build/buf/protovalidate/internal/evaluator/Evaluator.java +++ b/src/main/java/build/buf/protovalidate/internal/evaluator/Evaluator.java @@ -22,14 +22,22 @@ * checking of the passed in value, as the types have been guaranteed during the build phase. */ public interface Evaluator { - /** Returns true if the evaluator always succeeds. */ + /** + * Tautology returns true if the evaluator always succeeds. + * + * @return True if the evaluator always succeeds. + */ boolean tautology(); /** * Checks that the provided val is valid. Unless failFast is true, evaluation attempts to find all * {@link build.buf.validate.Violations} present in val instead of returning a {@link - * ValidationResult} on the first {@link build.buf.validate.Violation}. An {@link - * ExecutionException} is thrown if evaluation fails to complete. + * ValidationResult} on the first {@link build.buf.validate.Violation}. + * + * @param val The value to validate. + * @param failFast If true, validation stops after the first failure. + * @return The result of validation on the specified value. + * @throws ExecutionException If evaluation fails to complete. */ ValidationResult evaluate(Value val, boolean failFast) throws ExecutionException; } diff --git a/src/main/java/build/buf/protovalidate/internal/evaluator/EvaluatorBuilder.java b/src/main/java/build/buf/protovalidate/internal/evaluator/EvaluatorBuilder.java index 9721e254..a303ddb6 100644 --- a/src/main/java/build/buf/protovalidate/internal/evaluator/EvaluatorBuilder.java +++ b/src/main/java/build/buf/protovalidate/internal/evaluator/EvaluatorBuilder.java @@ -24,6 +24,7 @@ import build.buf.protovalidate.internal.expression.Variable; import build.buf.validate.Constraint; import build.buf.validate.FieldConstraints; +import build.buf.validate.Ignore; import build.buf.validate.MessageConstraints; import build.buf.validate.OneofConstraints; import build.buf.validate.ValidateProto; @@ -35,6 +36,7 @@ import com.google.protobuf.DynamicMessage; import com.google.protobuf.ExtensionRegistry; import com.google.protobuf.InvalidProtocolBufferException; +import com.google.protobuf.Message; import java.util.ArrayList; import java.util.Arrays; import java.util.Collections; @@ -76,6 +78,10 @@ public EvaluatorBuilder(Env env, boolean disableLazy) { /** * Returns a pre-cached {@link Evaluator} for the given descriptor or, if the descriptor is * unknown, returns an evaluator that always throws a {@link CompilationException}. + * + * @param desc Protobuf descriptor type. + * @return An evaluator for the descriptor type. + * @throws CompilationException If an evaluator can't be created for the specified descriptor. */ public Evaluator load(Descriptor desc) throws CompilationException { Evaluator evaluator = evaluatorCache.get(desc); @@ -130,7 +136,7 @@ private DescriptorCacheBuilder( } /** - * Creates a new immutable cache containing the descriptor (and any other descriptors it + * Creates an immutable cache containing the descriptor (and any other descriptors it * references). * * @param descriptor Descriptor used to build the cache. @@ -226,16 +232,40 @@ private FieldEvaluator buildField( FieldDescriptor fieldDescriptor, FieldConstraints fieldConstraints) throws CompilationException { ValueEvaluator valueEvaluatorEval = new ValueEvaluator(); + boolean ignoreDefault = + fieldDescriptor.hasPresence() && shouldIgnoreDefault(fieldConstraints); + Object zero = null; + if (ignoreDefault) { + zero = zeroValue(fieldDescriptor, false); + } FieldEvaluator fieldEvaluator = new FieldEvaluator( valueEvaluatorEval, fieldDescriptor, fieldConstraints.getRequired(), - fieldConstraints.getIgnoreEmpty() || fieldDescriptor.hasPresence()); + fieldDescriptor.hasPresence() || shouldIgnoreEmpty(fieldConstraints), + fieldDescriptor.hasPresence() && shouldIgnoreDefault(fieldConstraints), + zero); buildValue(fieldDescriptor, fieldConstraints, false, fieldEvaluator.valueEvaluator); return fieldEvaluator; } + @SuppressWarnings("deprecation") + private boolean shouldSkip(FieldConstraints constraints) { + return constraints.getSkipped() || constraints.getIgnore() == Ignore.IGNORE_ALWAYS; + } + + @SuppressWarnings("deprecation") + private static boolean shouldIgnoreEmpty(FieldConstraints constraints) { + return constraints.getIgnoreEmpty() + || constraints.getIgnore() == Ignore.IGNORE_IF_UNPOPULATED + || constraints.getIgnore() == Ignore.IGNORE_IF_DEFAULT_VALUE; + } + + private static boolean shouldIgnoreDefault(FieldConstraints constraints) { + return constraints.getIgnore() == Ignore.IGNORE_IF_DEFAULT_VALUE; + } + private void buildValue( FieldDescriptor fieldDescriptor, FieldConstraints fieldConstraints, @@ -257,42 +287,63 @@ private void processIgnoreEmpty( FieldDescriptor fieldDescriptor, FieldConstraints fieldConstraints, boolean forItems, - ValueEvaluator valueEvaluatorEval) { - if (forItems - && fieldConstraints.getIgnoreEmpty() - && fieldDescriptor.getType() != FieldDescriptor.Type.MESSAGE) { - Object zero = fieldDescriptor.getDefaultValue(); - if (fieldDescriptor.isRepeated()) { - switch (fieldDescriptor.getType().getJavaType()) { - case INT: - zero = 0; - break; - case LONG: - zero = 0L; - break; - case FLOAT: - zero = 0F; - break; - case DOUBLE: - zero = 0D; - break; - case BOOLEAN: - zero = false; - break; - case STRING: - zero = ""; - break; - case BYTE_STRING: - zero = ByteString.EMPTY; - break; - case ENUM: - zero = fieldDescriptor.getEnumType().getValues().get(0); - break; - default: - // noop - } + ValueEvaluator valueEvaluatorEval) + throws CompilationException { + if (forItems && shouldIgnoreEmpty(fieldConstraints)) { + valueEvaluatorEval.setIgnoreEmpty(zeroValue(fieldDescriptor, true)); + } + } + + private Object zeroValue(FieldDescriptor fieldDescriptor, boolean forItems) + throws CompilationException { + final Object zero; + if (forItems && fieldDescriptor.isRepeated()) { + switch (fieldDescriptor.getType().getJavaType()) { + case INT: + zero = 0; + break; + case LONG: + zero = 0L; + break; + case FLOAT: + zero = 0F; + break; + case DOUBLE: + zero = 0D; + break; + case BOOLEAN: + zero = false; + break; + case STRING: + zero = ""; + break; + case BYTE_STRING: + zero = ByteString.EMPTY; + break; + case ENUM: + zero = fieldDescriptor.getEnumType().getValues().get(0); + break; + case MESSAGE: + zero = createMessageForType(fieldDescriptor.getMessageType()); + break; + default: + zero = fieldDescriptor.getDefaultValue(); + break; } - valueEvaluatorEval.setIgnoreEmpty(zero); + } else if (fieldDescriptor.getJavaType() == FieldDescriptor.JavaType.MESSAGE + && !fieldDescriptor.isRepeated()) { + zero = createMessageForType(fieldDescriptor.getMessageType()); + } else { + zero = fieldDescriptor.getDefaultValue(); + } + return zero; + } + + private Message createMessageForType(Descriptor messageType) throws CompilationException { + try { + return DynamicMessage.parseFrom(messageType, new byte[0], EXTENSION_REGISTRY); + } catch (InvalidProtocolBufferException e) { + throw new CompilationException("field descriptor type is invalid " + e.getMessage(), e); } } @@ -343,7 +394,7 @@ private void processEmbeddedMessage( ValueEvaluator valueEvaluatorEval) throws CompilationException { if (fieldDescriptor.getType() != FieldDescriptor.Type.MESSAGE - || fieldConstraints.getSkipped() + || shouldSkip(fieldConstraints) || fieldDescriptor.isMapField() || (fieldDescriptor.isRepeated() && !forItems)) { return; @@ -359,7 +410,7 @@ private void processWrapperConstraints( ValueEvaluator valueEvaluatorEval) throws CompilationException { if (fieldDescriptor.getType() != FieldDescriptor.Type.MESSAGE - || fieldConstraints.getSkipped() + || shouldSkip(fieldConstraints) || fieldDescriptor.isMapField() || (fieldDescriptor.isRepeated() && !forItems)) { return; diff --git a/src/main/java/build/buf/protovalidate/internal/evaluator/FieldEvaluator.java b/src/main/java/build/buf/protovalidate/internal/evaluator/FieldEvaluator.java index fe4537c6..99b3c19d 100644 --- a/src/main/java/build/buf/protovalidate/internal/evaluator/FieldEvaluator.java +++ b/src/main/java/build/buf/protovalidate/internal/evaluator/FieldEvaluator.java @@ -21,6 +21,8 @@ import com.google.protobuf.Message; import java.util.Collections; import java.util.List; +import java.util.Objects; +import javax.annotation.Nullable; /** Performs validation on a single message field, defined by its descriptor. */ class FieldEvaluator implements Evaluator { @@ -34,21 +36,29 @@ class FieldEvaluator implements Evaluator { private final boolean required; /** - * IgnoreEmpty indicates if a field should skip validation on its zero value. This field is + * ignoreEmpty indicates if a field should skip validation on its zero value. This field is * generally true for nullable fields or fields with the ignore_empty constraint explicitly set. */ private final boolean ignoreEmpty; + private final boolean ignoreDefault; + + @Nullable private final Object zero; + /** Constructs a new {@link FieldEvaluator} */ FieldEvaluator( ValueEvaluator valueEvaluator, FieldDescriptor descriptor, boolean required, - boolean ignoreEmpty) { + boolean ignoreEmpty, + boolean ignoreDefault, + @Nullable Object zero) { this.valueEvaluator = valueEvaluator; this.descriptor = descriptor; this.required = required; this.ignoreEmpty = ignoreEmpty; + this.ignoreDefault = ignoreDefault; + this.zero = zero; } @Override @@ -81,6 +91,9 @@ public ValidationResult evaluate(Value val, boolean failFast) throws ExecutionEx return ValidationResult.EMPTY; } Object fieldValue = message.getField(descriptor); + if (ignoreDefault && Objects.equals(zero, fieldValue)) { + return ValidationResult.EMPTY; + } ValidationResult evalResult = valueEvaluator.evaluate(new ObjectValue(descriptor, fieldValue), failFast); List violations = diff --git a/src/main/java/build/buf/protovalidate/internal/expression/CelPrograms.java b/src/main/java/build/buf/protovalidate/internal/expression/CelPrograms.java index 23cc6119..2b0cab10 100644 --- a/src/main/java/build/buf/protovalidate/internal/expression/CelPrograms.java +++ b/src/main/java/build/buf/protovalidate/internal/expression/CelPrograms.java @@ -27,7 +27,11 @@ public class CelPrograms implements Evaluator { /** A list of {@link CompiledProgram} that will be executed against the input message. */ private final List programs; - /** Constructs a new {@link CelPrograms}. */ + /** + * Constructs a new {@link CelPrograms}. + * + * @param compiledPrograms The programs to execute. + */ public CelPrograms(List compiledPrograms) { this.programs = compiledPrograms; } diff --git a/src/main/java/build/buf/protovalidate/internal/expression/NowVariable.java b/src/main/java/build/buf/protovalidate/internal/expression/NowVariable.java index 03e83712..57440ff9 100644 --- a/src/main/java/build/buf/protovalidate/internal/expression/NowVariable.java +++ b/src/main/java/build/buf/protovalidate/internal/expression/NowVariable.java @@ -31,6 +31,9 @@ public class NowVariable implements Activation { /** The resolved value of the 'now' variable. */ @Nullable private ResolvedValue resolvedValue; + /** Creates an instance of a "now" variable. */ + public NowVariable() {} + @Override public ResolvedValue resolveName(String name) { if (!name.equals(NOW_NAME)) { diff --git a/src/main/java/build/buf/protovalidate/internal/expression/Variable.java b/src/main/java/build/buf/protovalidate/internal/expression/Variable.java index 6d458375..27bbaed2 100644 --- a/src/main/java/build/buf/protovalidate/internal/expression/Variable.java +++ b/src/main/java/build/buf/protovalidate/internal/expression/Variable.java @@ -23,7 +23,10 @@ * lightweight named variable to cel.Program executions. */ public class Variable implements Activation { + /** The {@value} variable in CEL. */ public static final String THIS_NAME = "this"; + + /** The {@value} variable in CEL. */ public static final String RULES_NAME = "rules"; /** The parent activation */ @@ -35,7 +38,7 @@ public class Variable implements Activation { /** The value for this variable */ @Nullable private final Object val; - /** Creates a new variable with the given name and value. */ + /** Creates a variable with the given name and value. */ private Variable(Activation activation, String name, @Nullable Object val) { this.next = activation; this.name = name; @@ -43,7 +46,7 @@ private Variable(Activation activation, String name, @Nullable Object val) { } /** - * Creates a new "this" variable. + * Creates a "this" variable. * * @param val the value. * @return {@link Variable}. @@ -53,7 +56,7 @@ public static Variable newThisVariable(@Nullable Object val) { } /** - * Creates a new "rules" variable. + * Creates a "rules" variable. * * @param val the value. * @return {@link Variable}. diff --git a/src/main/java/build/buf/validate/EnumRules.java b/src/main/java/build/buf/validate/EnumRules.java index 93c791e1..5c21ff91 100644 --- a/src/main/java/build/buf/validate/EnumRules.java +++ b/src/main/java/build/buf/validate/EnumRules.java @@ -175,7 +175,7 @@ public boolean getDefinedOnly() { * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -203,7 +203,7 @@ public boolean getDefinedOnly() { * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -229,7 +229,7 @@ public int getInCount() { * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -262,7 +262,7 @@ public int getIn(int index) { * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * @@ -290,7 +290,7 @@ public int getIn(int index) { * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * @@ -316,7 +316,7 @@ public int getNotInCount() { * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * @@ -1062,7 +1062,7 @@ private void ensureInIsMutable() { * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -1090,7 +1090,7 @@ private void ensureInIsMutable() { * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -1116,7 +1116,7 @@ public int getInCount() { * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -1143,7 +1143,7 @@ public int getIn(int index) { * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -1177,7 +1177,7 @@ public Builder setIn( * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -1209,7 +1209,7 @@ public Builder addIn(int value) { * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -1242,7 +1242,7 @@ public Builder addAllIn( * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -1279,7 +1279,7 @@ private void ensureNotInIsMutable() { * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * @@ -1307,7 +1307,7 @@ private void ensureNotInIsMutable() { * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * @@ -1333,7 +1333,7 @@ public int getNotInCount() { * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * @@ -1360,7 +1360,7 @@ public int getNotIn(int index) { * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * @@ -1394,7 +1394,7 @@ public Builder setNotIn( * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * @@ -1426,7 +1426,7 @@ public Builder addNotIn(int value) { * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * @@ -1459,7 +1459,7 @@ public Builder addAllNotIn( * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * diff --git a/src/main/java/build/buf/validate/EnumRulesOrBuilder.java b/src/main/java/build/buf/validate/EnumRulesOrBuilder.java index af4eb67b..58d897a3 100644 --- a/src/main/java/build/buf/validate/EnumRulesOrBuilder.java +++ b/src/main/java/build/buf/validate/EnumRulesOrBuilder.java @@ -117,7 +117,7 @@ public interface EnumRulesOrBuilder extends * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -141,7 +141,7 @@ public interface EnumRulesOrBuilder extends * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -165,7 +165,7 @@ public interface EnumRulesOrBuilder extends * * message MyMessage { * // The field `value` must be equal to one of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}]; * } * ``` * @@ -191,7 +191,7 @@ public interface EnumRulesOrBuilder extends * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * @@ -215,7 +215,7 @@ public interface EnumRulesOrBuilder extends * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * @@ -239,7 +239,7 @@ public interface EnumRulesOrBuilder extends * * message MyMessage { * // The field `value` must not be equal to any of the specified values. - * MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}]; + * MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}]; * } * ``` * diff --git a/src/main/java/build/buf/validate/FieldConstraints.java b/src/main/java/build/buf/validate/FieldConstraints.java index 65afc8ae..98e73af6 100644 --- a/src/main/java/build/buf/validate/FieldConstraints.java +++ b/src/main/java/build/buf/validate/FieldConstraints.java @@ -23,6 +23,7 @@ private FieldConstraints(com.google.protobuf.GeneratedMessageV3.Builder build } private FieldConstraints() { cel_ = java.util.Collections.emptyList(); + ignore_ = 0; } @java.lang.Override @@ -251,44 +252,20 @@ public build.buf.validate.ConstraintOrBuilder getCelOrBuilder( return cel_.get(index); } - public static final int SKIPPED_FIELD_NUMBER = 24; - private boolean skipped_ = false; - /** - *
-   * `skipped` is an optional boolean attribute that specifies that the
-   * validation rules of this field should not be evaluated. If skipped is set to
-   * true, any validation rules set for the field will be ignored.
-   *
-   * ```proto
-   * message MyMessage {
-   *   // The field `value` must not be set.
-   *   optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true];
-   * }
-   * ```
-   * 
- * - * bool skipped = 24 [json_name = "skipped"]; - * @return The skipped. - */ - @java.lang.Override - public boolean getSkipped() { - return skipped_; - } - public static final int REQUIRED_FIELD_NUMBER = 25; private boolean required_ = false; /** *
-   * If `required` is true, the field must be populated. Field presence can be
-   * described as "serialized in the wire format," which follows the following rules:
+   * If `required` is true, the field must be populated. A populated field can be
+   * described as "serialized in the wire format," which includes:
    *
-   * - the following "nullable" fields must be explicitly set to be considered present:
-   *   - singular message fields (may be their empty value)
+   * - the following "nullable" fields must be explicitly set to be considered populated:
+   *   - singular message fields (whose fields may be unpopulated/default values)
    *   - member fields of a oneof (may be their default value)
    *   - proto3 optional fields (may be their default value)
-   *   - proto2 scalar fields
-   * - proto3 scalar fields must be non-zero to be considered present
-   * - repeated and map fields must be non-empty to be considered present
+   *   - proto2 scalar fields (both optional and required)
+   * - proto3 scalar fields must be non-zero to be considered populated
+   * - repeated and map fields must be non-empty to be considered populated
    *
    * ```proto
    * message MyMessage {
@@ -306,33 +283,54 @@ public boolean getRequired() {
     return required_;
   }
 
-  public static final int IGNORE_EMPTY_FIELD_NUMBER = 26;
-  private boolean ignoreEmpty_ = false;
+  public static final int IGNORE_FIELD_NUMBER = 27;
+  private int ignore_ = 0;
   /**
    * 
-   * If `ignore_empty` is true and applied to a non-nullable field (see
-   * `required` for more details), validation is skipped on the field if it is
-   * the default or empty value. Adding `ignore_empty` to a "nullable" field is
-   * a noop as these unset fields already skip validation (with the exception
-   * of `required`).
+   * Skip validation on the field if its value matches the specified criteria.
+   * See Ignore enum for details.
    *
    * ```proto
-   * message MyRepeated {
-   *   // The field `value` min_len rule is only applied if the field isn't empty.
-   *   repeated string value = 1 [
-   *     (buf.validate.field).ignore_empty = true,
-   *     (buf.validate.field).min_len = 5
+   * message UpdateRequest {
+   *   // The uri rule only applies if the field is populated and not an empty
+   *   // string.
+   *   optional string url = 1 [
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
+   *     (buf.validate.field).string.uri = true,
    *   ];
    * }
    * ```
    * 
* - * bool ignore_empty = 26 [json_name = "ignoreEmpty"]; - * @return The ignoreEmpty. + * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * @return The enum numeric value on the wire for ignore. */ - @java.lang.Override - public boolean getIgnoreEmpty() { - return ignoreEmpty_; + @java.lang.Override public int getIgnoreValue() { + return ignore_; + } + /** + *
+   * Skip validation on the field if its value matches the specified criteria.
+   * See Ignore enum for details.
+   *
+   * ```proto
+   * message UpdateRequest {
+   *   // The uri rule only applies if the field is populated and not an empty
+   *   // string.
+   *   optional string url = 1 [
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
+   *     (buf.validate.field).string.uri = true,
+   *   ];
+   * }
+   * ```
+   * 
+ * + * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * @return The ignore. + */ + @java.lang.Override public build.buf.validate.Ignore getIgnore() { + build.buf.validate.Ignore result = build.buf.validate.Ignore.forNumber(ignore_); + return result == null ? build.buf.validate.Ignore.UNRECOGNIZED : result; } public static final int FLOAT_FIELD_NUMBER = 1; @@ -1022,6 +1020,40 @@ public build.buf.validate.TimestampRulesOrBuilder getTimestampOrBuilder() { return build.buf.validate.TimestampRules.getDefaultInstance(); } + public static final int SKIPPED_FIELD_NUMBER = 24; + private boolean skipped_ = false; + /** + *
+   * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1.
+   * 
+ * + * bool skipped = 24 [json_name = "skipped", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.skipped is deprecated. + * See buf/validate/validate.proto;l=196 + * @return The skipped. + */ + @java.lang.Override + @java.lang.Deprecated public boolean getSkipped() { + return skipped_; + } + + public static final int IGNORE_EMPTY_FIELD_NUMBER = 26; + private boolean ignoreEmpty_ = false; + /** + *
+   * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1.
+   * 
+ * + * bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. + * See buf/validate/validate.proto;l=198 + * @return The ignoreEmpty. + */ + @java.lang.Override + @java.lang.Deprecated public boolean getIgnoreEmpty() { + return ignoreEmpty_; + } + private byte memoizedIsInitialized = -1; @java.lang.Override public final boolean isInitialized() { @@ -1111,6 +1143,9 @@ public void writeTo(com.google.protobuf.CodedOutputStream output) if (ignoreEmpty_ != false) { output.writeBool(26, ignoreEmpty_); } + if (ignore_ != build.buf.validate.Ignore.IGNORE_UNSPECIFIED.getNumber()) { + output.writeEnum(27, ignore_); + } getUnknownFields().writeTo(output); } @@ -1220,6 +1255,10 @@ public int getSerializedSize() { size += com.google.protobuf.CodedOutputStream .computeBoolSize(26, ignoreEmpty_); } + if (ignore_ != build.buf.validate.Ignore.IGNORE_UNSPECIFIED.getNumber()) { + size += com.google.protobuf.CodedOutputStream + .computeEnumSize(27, ignore_); + } size += getUnknownFields().getSerializedSize(); memoizedSize = size; return size; @@ -1237,10 +1276,11 @@ public boolean equals(final java.lang.Object obj) { if (!getCelList() .equals(other.getCelList())) return false; - if (getSkipped() - != other.getSkipped()) return false; if (getRequired() != other.getRequired()) return false; + if (ignore_ != other.ignore_) return false; + if (getSkipped() + != other.getSkipped()) return false; if (getIgnoreEmpty() != other.getIgnoreEmpty()) return false; if (!getTypeCase().equals(other.getTypeCase())) return false; @@ -1347,12 +1387,14 @@ public int hashCode() { hash = (37 * hash) + CEL_FIELD_NUMBER; hash = (53 * hash) + getCelList().hashCode(); } - hash = (37 * hash) + SKIPPED_FIELD_NUMBER; - hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( - getSkipped()); hash = (37 * hash) + REQUIRED_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getRequired()); + hash = (37 * hash) + IGNORE_FIELD_NUMBER; + hash = (53 * hash) + ignore_; + hash = (37 * hash) + SKIPPED_FIELD_NUMBER; + hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( + getSkipped()); hash = (37 * hash) + IGNORE_EMPTY_FIELD_NUMBER; hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean( getIgnoreEmpty()); @@ -1587,9 +1629,8 @@ public Builder clear() { celBuilder_.clear(); } bitField0_ = (bitField0_ & ~0x00000001); - skipped_ = false; required_ = false; - ignoreEmpty_ = false; + ignore_ = 0; if (floatBuilder_ != null) { floatBuilder_.clear(); } @@ -1653,6 +1694,8 @@ public Builder clear() { if (timestampBuilder_ != null) { timestampBuilder_.clear(); } + skipped_ = false; + ignoreEmpty_ = false; typeCase_ = 0; type_ = null; return this; @@ -1703,12 +1746,15 @@ private void buildPartialRepeatedFields(build.buf.validate.FieldConstraints resu private void buildPartial0(build.buf.validate.FieldConstraints result) { int from_bitField0_ = bitField0_; if (((from_bitField0_ & 0x00000002) != 0)) { - result.skipped_ = skipped_; + result.required_ = required_; } if (((from_bitField0_ & 0x00000004) != 0)) { - result.required_ = required_; + result.ignore_ = ignore_; } - if (((from_bitField0_ & 0x00000008) != 0)) { + if (((from_bitField0_ & 0x01000000) != 0)) { + result.skipped_ = skipped_; + } + if (((from_bitField0_ & 0x02000000) != 0)) { result.ignoreEmpty_ = ignoreEmpty_; } } @@ -1872,12 +1918,15 @@ public Builder mergeFrom(build.buf.validate.FieldConstraints other) { } } } - if (other.getSkipped() != false) { - setSkipped(other.getSkipped()); - } if (other.getRequired() != false) { setRequired(other.getRequired()); } + if (other.ignore_ != 0) { + setIgnoreValue(other.getIgnoreValue()); + } + if (other.getSkipped() != false) { + setSkipped(other.getSkipped()); + } if (other.getIgnoreEmpty() != false) { setIgnoreEmpty(other.getIgnoreEmpty()); } @@ -2158,19 +2207,24 @@ public Builder mergeFrom( } // case 186 case 192: { skipped_ = input.readBool(); - bitField0_ |= 0x00000002; + bitField0_ |= 0x01000000; break; } // case 192 case 200: { required_ = input.readBool(); - bitField0_ |= 0x00000004; + bitField0_ |= 0x00000002; break; } // case 200 case 208: { ignoreEmpty_ = input.readBool(); - bitField0_ |= 0x00000008; + bitField0_ |= 0x02000000; break; } // case 208 + case 216: { + ignore_ = input.readEnum(); + bitField0_ |= 0x00000004; + break; + } // case 216 default: { if (!super.parseUnknownField(input, extensionRegistry, tag)) { done = true; // was an endgroup tag @@ -2749,90 +2803,19 @@ public build.buf.validate.Constraint.Builder addCelBuilder( return celBuilder_; } - private boolean skipped_ ; - /** - *
-     * `skipped` is an optional boolean attribute that specifies that the
-     * validation rules of this field should not be evaluated. If skipped is set to
-     * true, any validation rules set for the field will be ignored.
-     *
-     * ```proto
-     * message MyMessage {
-     *   // The field `value` must not be set.
-     *   optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true];
-     * }
-     * ```
-     * 
- * - * bool skipped = 24 [json_name = "skipped"]; - * @return The skipped. - */ - @java.lang.Override - public boolean getSkipped() { - return skipped_; - } - /** - *
-     * `skipped` is an optional boolean attribute that specifies that the
-     * validation rules of this field should not be evaluated. If skipped is set to
-     * true, any validation rules set for the field will be ignored.
-     *
-     * ```proto
-     * message MyMessage {
-     *   // The field `value` must not be set.
-     *   optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true];
-     * }
-     * ```
-     * 
- * - * bool skipped = 24 [json_name = "skipped"]; - * @param value The skipped to set. - * @return This builder for chaining. - */ - public Builder setSkipped(boolean value) { - - skipped_ = value; - bitField0_ |= 0x00000002; - onChanged(); - return this; - } - /** - *
-     * `skipped` is an optional boolean attribute that specifies that the
-     * validation rules of this field should not be evaluated. If skipped is set to
-     * true, any validation rules set for the field will be ignored.
-     *
-     * ```proto
-     * message MyMessage {
-     *   // The field `value` must not be set.
-     *   optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true];
-     * }
-     * ```
-     * 
- * - * bool skipped = 24 [json_name = "skipped"]; - * @return This builder for chaining. - */ - public Builder clearSkipped() { - bitField0_ = (bitField0_ & ~0x00000002); - skipped_ = false; - onChanged(); - return this; - } - private boolean required_ ; /** *
-     * If `required` is true, the field must be populated. Field presence can be
-     * described as "serialized in the wire format," which follows the following rules:
+     * If `required` is true, the field must be populated. A populated field can be
+     * described as "serialized in the wire format," which includes:
      *
-     * - the following "nullable" fields must be explicitly set to be considered present:
-     *   - singular message fields (may be their empty value)
+     * - the following "nullable" fields must be explicitly set to be considered populated:
+     *   - singular message fields (whose fields may be unpopulated/default values)
      *   - member fields of a oneof (may be their default value)
      *   - proto3 optional fields (may be their default value)
-     *   - proto2 scalar fields
-     * - proto3 scalar fields must be non-zero to be considered present
-     * - repeated and map fields must be non-empty to be considered present
+     *   - proto2 scalar fields (both optional and required)
+     * - proto3 scalar fields must be non-zero to be considered populated
+     * - repeated and map fields must be non-empty to be considered populated
      *
      * ```proto
      * message MyMessage {
@@ -2851,16 +2834,16 @@ public boolean getRequired() {
     }
     /**
      * 
-     * If `required` is true, the field must be populated. Field presence can be
-     * described as "serialized in the wire format," which follows the following rules:
+     * If `required` is true, the field must be populated. A populated field can be
+     * described as "serialized in the wire format," which includes:
      *
-     * - the following "nullable" fields must be explicitly set to be considered present:
-     *   - singular message fields (may be their empty value)
+     * - the following "nullable" fields must be explicitly set to be considered populated:
+     *   - singular message fields (whose fields may be unpopulated/default values)
      *   - member fields of a oneof (may be their default value)
      *   - proto3 optional fields (may be their default value)
-     *   - proto2 scalar fields
-     * - proto3 scalar fields must be non-zero to be considered present
-     * - repeated and map fields must be non-empty to be considered present
+     *   - proto2 scalar fields (both optional and required)
+     * - proto3 scalar fields must be non-zero to be considered populated
+     * - repeated and map fields must be non-empty to be considered populated
      *
      * ```proto
      * message MyMessage {
@@ -2877,22 +2860,22 @@ public boolean getRequired() {
     public Builder setRequired(boolean value) {
 
       required_ = value;
-      bitField0_ |= 0x00000004;
+      bitField0_ |= 0x00000002;
       onChanged();
       return this;
     }
     /**
      * 
-     * If `required` is true, the field must be populated. Field presence can be
-     * described as "serialized in the wire format," which follows the following rules:
+     * If `required` is true, the field must be populated. A populated field can be
+     * described as "serialized in the wire format," which includes:
      *
-     * - the following "nullable" fields must be explicitly set to be considered present:
-     *   - singular message fields (may be their empty value)
+     * - the following "nullable" fields must be explicitly set to be considered populated:
+     *   - singular message fields (whose fields may be unpopulated/default values)
      *   - member fields of a oneof (may be their default value)
      *   - proto3 optional fields (may be their default value)
-     *   - proto2 scalar fields
-     * - proto3 scalar fields must be non-zero to be considered present
-     * - repeated and map fields must be non-empty to be considered present
+     *   - proto2 scalar fields (both optional and required)
+     * - proto3 scalar fields must be non-zero to be considered populated
+     * - repeated and map fields must be non-empty to be considered populated
      *
      * ```proto
      * message MyMessage {
@@ -2906,94 +2889,141 @@ public Builder setRequired(boolean value) {
      * @return This builder for chaining.
      */
     public Builder clearRequired() {
-      bitField0_ = (bitField0_ & ~0x00000004);
+      bitField0_ = (bitField0_ & ~0x00000002);
       required_ = false;
       onChanged();
       return this;
     }
 
-    private boolean ignoreEmpty_ ;
+    private int ignore_ = 0;
     /**
      * 
-     * If `ignore_empty` is true and applied to a non-nullable field (see
-     * `required` for more details), validation is skipped on the field if it is
-     * the default or empty value. Adding `ignore_empty` to a "nullable" field is
-     * a noop as these unset fields already skip validation (with the exception
-     * of `required`).
+     * Skip validation on the field if its value matches the specified criteria.
+     * See Ignore enum for details.
      *
      * ```proto
-     * message MyRepeated {
-     *   // The field `value` min_len rule is only applied if the field isn't empty.
-     *   repeated string value = 1 [
-     *     (buf.validate.field).ignore_empty = true,
-     *     (buf.validate.field).min_len = 5
+     * message UpdateRequest {
+     *   // The uri rule only applies if the field is populated and not an empty
+     *   // string.
+     *   optional string url = 1 [
+     *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
+     *     (buf.validate.field).string.uri = true,
      *   ];
      * }
      * ```
      * 
* - * bool ignore_empty = 26 [json_name = "ignoreEmpty"]; - * @return The ignoreEmpty. + * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * @return The enum numeric value on the wire for ignore. + */ + @java.lang.Override public int getIgnoreValue() { + return ignore_; + } + /** + *
+     * Skip validation on the field if its value matches the specified criteria.
+     * See Ignore enum for details.
+     *
+     * ```proto
+     * message UpdateRequest {
+     *   // The uri rule only applies if the field is populated and not an empty
+     *   // string.
+     *   optional string url = 1 [
+     *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
+     *     (buf.validate.field).string.uri = true,
+     *   ];
+     * }
+     * ```
+     * 
+ * + * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * @param value The enum numeric value on the wire for ignore to set. + * @return This builder for chaining. + */ + public Builder setIgnoreValue(int value) { + ignore_ = value; + bitField0_ |= 0x00000004; + onChanged(); + return this; + } + /** + *
+     * Skip validation on the field if its value matches the specified criteria.
+     * See Ignore enum for details.
+     *
+     * ```proto
+     * message UpdateRequest {
+     *   // The uri rule only applies if the field is populated and not an empty
+     *   // string.
+     *   optional string url = 1 [
+     *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
+     *     (buf.validate.field).string.uri = true,
+     *   ];
+     * }
+     * ```
+     * 
+ * + * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * @return The ignore. */ @java.lang.Override - public boolean getIgnoreEmpty() { - return ignoreEmpty_; + public build.buf.validate.Ignore getIgnore() { + build.buf.validate.Ignore result = build.buf.validate.Ignore.forNumber(ignore_); + return result == null ? build.buf.validate.Ignore.UNRECOGNIZED : result; } /** *
-     * If `ignore_empty` is true and applied to a non-nullable field (see
-     * `required` for more details), validation is skipped on the field if it is
-     * the default or empty value. Adding `ignore_empty` to a "nullable" field is
-     * a noop as these unset fields already skip validation (with the exception
-     * of `required`).
+     * Skip validation on the field if its value matches the specified criteria.
+     * See Ignore enum for details.
      *
      * ```proto
-     * message MyRepeated {
-     *   // The field `value` min_len rule is only applied if the field isn't empty.
-     *   repeated string value = 1 [
-     *     (buf.validate.field).ignore_empty = true,
-     *     (buf.validate.field).min_len = 5
+     * message UpdateRequest {
+     *   // The uri rule only applies if the field is populated and not an empty
+     *   // string.
+     *   optional string url = 1 [
+     *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
+     *     (buf.validate.field).string.uri = true,
      *   ];
      * }
      * ```
      * 
* - * bool ignore_empty = 26 [json_name = "ignoreEmpty"]; - * @param value The ignoreEmpty to set. + * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * @param value The ignore to set. * @return This builder for chaining. */ - public Builder setIgnoreEmpty(boolean value) { - - ignoreEmpty_ = value; - bitField0_ |= 0x00000008; + public Builder setIgnore(build.buf.validate.Ignore value) { + if (value == null) { + throw new NullPointerException(); + } + bitField0_ |= 0x00000004; + ignore_ = value.getNumber(); onChanged(); return this; } /** *
-     * If `ignore_empty` is true and applied to a non-nullable field (see
-     * `required` for more details), validation is skipped on the field if it is
-     * the default or empty value. Adding `ignore_empty` to a "nullable" field is
-     * a noop as these unset fields already skip validation (with the exception
-     * of `required`).
+     * Skip validation on the field if its value matches the specified criteria.
+     * See Ignore enum for details.
      *
      * ```proto
-     * message MyRepeated {
-     *   // The field `value` min_len rule is only applied if the field isn't empty.
-     *   repeated string value = 1 [
-     *     (buf.validate.field).ignore_empty = true,
-     *     (buf.validate.field).min_len = 5
+     * message UpdateRequest {
+     *   // The uri rule only applies if the field is populated and not an empty
+     *   // string.
+     *   optional string url = 1 [
+     *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
+     *     (buf.validate.field).string.uri = true,
      *   ];
      * }
      * ```
      * 
* - * bool ignore_empty = 26 [json_name = "ignoreEmpty"]; + * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; * @return This builder for chaining. */ - public Builder clearIgnoreEmpty() { - bitField0_ = (bitField0_ & ~0x00000008); - ignoreEmpty_ = false; + public Builder clearIgnore() { + bitField0_ = (bitField0_ & ~0x00000004); + ignore_ = 0; onChanged(); return this; } @@ -6087,6 +6117,106 @@ public build.buf.validate.TimestampRulesOrBuilder getTimestampOrBuilder() { onChanged(); return timestampBuilder_; } + + private boolean skipped_ ; + /** + *
+     * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1.
+     * 
+ * + * bool skipped = 24 [json_name = "skipped", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.skipped is deprecated. + * See buf/validate/validate.proto;l=196 + * @return The skipped. + */ + @java.lang.Override + @java.lang.Deprecated public boolean getSkipped() { + return skipped_; + } + /** + *
+     * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1.
+     * 
+ * + * bool skipped = 24 [json_name = "skipped", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.skipped is deprecated. + * See buf/validate/validate.proto;l=196 + * @param value The skipped to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setSkipped(boolean value) { + + skipped_ = value; + bitField0_ |= 0x01000000; + onChanged(); + return this; + } + /** + *
+     * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1.
+     * 
+ * + * bool skipped = 24 [json_name = "skipped", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.skipped is deprecated. + * See buf/validate/validate.proto;l=196 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearSkipped() { + bitField0_ = (bitField0_ & ~0x01000000); + skipped_ = false; + onChanged(); + return this; + } + + private boolean ignoreEmpty_ ; + /** + *
+     * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1.
+     * 
+ * + * bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. + * See buf/validate/validate.proto;l=198 + * @return The ignoreEmpty. + */ + @java.lang.Override + @java.lang.Deprecated public boolean getIgnoreEmpty() { + return ignoreEmpty_; + } + /** + *
+     * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1.
+     * 
+ * + * bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. + * See buf/validate/validate.proto;l=198 + * @param value The ignoreEmpty to set. + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder setIgnoreEmpty(boolean value) { + + ignoreEmpty_ = value; + bitField0_ |= 0x02000000; + onChanged(); + return this; + } + /** + *
+     * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1.
+     * 
+ * + * bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. + * See buf/validate/validate.proto;l=198 + * @return This builder for chaining. + */ + @java.lang.Deprecated public Builder clearIgnoreEmpty() { + bitField0_ = (bitField0_ & ~0x02000000); + ignoreEmpty_ = false; + onChanged(); + return this; + } @java.lang.Override public final Builder setUnknownFields( final com.google.protobuf.UnknownFieldSet unknownFields) { diff --git a/src/main/java/build/buf/validate/FieldConstraintsOrBuilder.java b/src/main/java/build/buf/validate/FieldConstraintsOrBuilder.java index 18c19d11..34364c08 100644 --- a/src/main/java/build/buf/validate/FieldConstraintsOrBuilder.java +++ b/src/main/java/build/buf/validate/FieldConstraintsOrBuilder.java @@ -119,72 +119,72 @@ build.buf.validate.ConstraintOrBuilder getCelOrBuilder( /** *
-   * `skipped` is an optional boolean attribute that specifies that the
-   * validation rules of this field should not be evaluated. If skipped is set to
-   * true, any validation rules set for the field will be ignored.
+   * If `required` is true, the field must be populated. A populated field can be
+   * described as "serialized in the wire format," which includes:
+   *
+   * - the following "nullable" fields must be explicitly set to be considered populated:
+   *   - singular message fields (whose fields may be unpopulated/default values)
+   *   - member fields of a oneof (may be their default value)
+   *   - proto3 optional fields (may be their default value)
+   *   - proto2 scalar fields (both optional and required)
+   * - proto3 scalar fields must be non-zero to be considered populated
+   * - repeated and map fields must be non-empty to be considered populated
    *
    * ```proto
    * message MyMessage {
-   *   // The field `value` must not be set.
-   *   optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true];
+   *   // The field `value` must be set to a non-null value.
+   *   optional MyOtherMessage value = 1 [(buf.validate.field).required = true];
    * }
    * ```
    * 
* - * bool skipped = 24 [json_name = "skipped"]; - * @return The skipped. + * bool required = 25 [json_name = "required"]; + * @return The required. */ - boolean getSkipped(); + boolean getRequired(); /** *
-   * If `required` is true, the field must be populated. Field presence can be
-   * described as "serialized in the wire format," which follows the following rules:
-   *
-   * - the following "nullable" fields must be explicitly set to be considered present:
-   *   - singular message fields (may be their empty value)
-   *   - member fields of a oneof (may be their default value)
-   *   - proto3 optional fields (may be their default value)
-   *   - proto2 scalar fields
-   * - proto3 scalar fields must be non-zero to be considered present
-   * - repeated and map fields must be non-empty to be considered present
+   * Skip validation on the field if its value matches the specified criteria.
+   * See Ignore enum for details.
    *
    * ```proto
-   * message MyMessage {
-   *   // The field `value` must be set to a non-null value.
-   *   optional MyOtherMessage value = 1 [(buf.validate.field).required = true];
+   * message UpdateRequest {
+   *   // The uri rule only applies if the field is populated and not an empty
+   *   // string.
+   *   optional string url = 1 [
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
+   *     (buf.validate.field).string.uri = true,
+   *   ];
    * }
    * ```
    * 
* - * bool required = 25 [json_name = "required"]; - * @return The required. + * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * @return The enum numeric value on the wire for ignore. */ - boolean getRequired(); - + int getIgnoreValue(); /** *
-   * If `ignore_empty` is true and applied to a non-nullable field (see
-   * `required` for more details), validation is skipped on the field if it is
-   * the default or empty value. Adding `ignore_empty` to a "nullable" field is
-   * a noop as these unset fields already skip validation (with the exception
-   * of `required`).
+   * Skip validation on the field if its value matches the specified criteria.
+   * See Ignore enum for details.
    *
    * ```proto
-   * message MyRepeated {
-   *   // The field `value` min_len rule is only applied if the field isn't empty.
-   *   repeated string value = 1 [
-   *     (buf.validate.field).ignore_empty = true,
-   *     (buf.validate.field).min_len = 5
+   * message UpdateRequest {
+   *   // The uri rule only applies if the field is populated and not an empty
+   *   // string.
+   *   optional string url = 1 [
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
+   *     (buf.validate.field).string.uri = true,
    *   ];
    * }
    * ```
    * 
* - * bool ignore_empty = 26 [json_name = "ignoreEmpty"]; - * @return The ignoreEmpty. + * .buf.validate.Ignore ignore = 27 [json_name = "ignore"]; + * @return The ignore. */ - boolean getIgnoreEmpty(); + build.buf.validate.Ignore getIgnore(); /** *
@@ -537,5 +537,29 @@ build.buf.validate.ConstraintOrBuilder getCelOrBuilder(
    */
   build.buf.validate.TimestampRulesOrBuilder getTimestampOrBuilder();
 
+  /**
+   * 
+   * DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1.
+   * 
+ * + * bool skipped = 24 [json_name = "skipped", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.skipped is deprecated. + * See buf/validate/validate.proto;l=196 + * @return The skipped. + */ + @java.lang.Deprecated boolean getSkipped(); + + /** + *
+   * DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1.
+   * 
+ * + * bool ignore_empty = 26 [json_name = "ignoreEmpty", deprecated = true]; + * @deprecated buf.validate.FieldConstraints.ignore_empty is deprecated. + * See buf/validate/validate.proto;l=198 + * @return The ignoreEmpty. + */ + @java.lang.Deprecated boolean getIgnoreEmpty(); + build.buf.validate.FieldConstraints.TypeCase getTypeCase(); } diff --git a/src/main/java/build/buf/validate/Ignore.java b/src/main/java/build/buf/validate/Ignore.java new file mode 100644 index 00000000..02d7bf22 --- /dev/null +++ b/src/main/java/build/buf/validate/Ignore.java @@ -0,0 +1,467 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: buf/validate/validate.proto + +// Protobuf Java Version: 3.25.3 +package build.buf.validate; + +/** + *
+ * Specifies how FieldConstraints.ignore behaves. See the documentation for
+ * FieldConstraints.required for definitions of "populated" and "nullable".
+ * 
+ * + * Protobuf enum {@code buf.validate.Ignore} + */ +public enum Ignore + implements com.google.protobuf.ProtocolMessageEnum { + /** + *
+   * Validation is only skipped if it's an unpopulated nullable fields.
+   *
+   * ```proto
+   * syntax="proto3";
+   *
+   * message Request {
+   *   // The uri rule applies to any value, including the empty string.
+   *   string foo = 1 [
+   *     (buf.validate.field).string.uri = true
+   *   ];
+   *
+   *   // The uri rule only applies if the field is set, including if it's
+   *   // set to the empty string.
+   *   optional string bar = 2 [
+   *     (buf.validate.field).string.uri = true
+   *   ];
+   *
+   *   // The min_items rule always applies, even if the list is empty.
+   *   repeated string baz = 3 [
+   *     (buf.validate.field).repeated.min_items = 3
+   *   ];
+   *
+   *   // The custom CEL rule applies only if the field is set, including if
+   *   // it's the "zero" value of that message.
+   *   SomeMessage quux = 4 [
+   *     (buf.validate.field).cel = {/* ... */}
+   *   ];
+   * }
+   * ```
+   * 
+ * + * IGNORE_UNSPECIFIED = 0; + */ + IGNORE_UNSPECIFIED(0), + /** + *
+   * Validation is skipped if the field is unpopulated. This rule is redundant
+   * if the field is already nullable. This value is equivalent behavior to the
+   * deprecated ignore_empty rule.
+   *
+   * ```proto
+   * syntax="proto3
+   *
+   * message Request {
+   *   // The uri rule applies only if the value is not the empty string.
+   *   string foo = 1 [
+   *     (buf.validate.field).string.uri = true,
+   *     (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
+   *   ];
+   *
+   *   // IGNORE_IF_UNPOPULATED is equivalent to IGNORE_UNSPECIFIED in this
+   *   // case: the uri rule only applies if the field is set, including if
+   *   // it's set to the empty string.
+   *   optional string bar = 2 [
+   *     (buf.validate.field).string.uri = true,
+   *     (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
+   *   ];
+   *
+   *   // The min_items rule only applies if the list has at least one item.
+   *   repeated string baz = 3 [
+   *     (buf.validate.field).repeated.min_items = 3,
+   *     (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
+   *   ];
+   *
+   *   // IGNORE_IF_UNPOPULATED is equivalent to IGNORE_UNSPECIFIED in this
+   *   // case: the custom CEL rule applies only if the field is set, including
+   *   // if it's the "zero" value of that message.
+   *   SomeMessage quux = 4 [
+   *     (buf.validate.field).cel = {/* ... */},
+   *     (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
+   *   ];
+   * }
+   * ```
+   * 
+ * + * IGNORE_IF_UNPOPULATED = 1; + */ + IGNORE_IF_UNPOPULATED(1), + /** + *
+   * Validation is skipped if the field is unpopulated or if it is a nullable
+   * field populated with its default value. This is typically the zero or
+   * empty value, but proto2 scalars support custom defaults. For messages, the
+   * default is a non-null message with all its fields unpopulated.
+   *
+   * ```proto
+   * syntax="proto3
+   *
+   * message Request {
+   *   // IGNORE_IF_DEFAULT_VALUE is equivalent to IGNORE_IF_UNPOPULATED in
+   *   // this case; the uri rule applies only if the value is not the empty
+   *   // string.
+   *   string foo = 1 [
+   *     (buf.validate.field).string.uri = true,
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+   *   ];
+   *
+   *   // The uri rule only applies if the field is set to a value other than
+   *   // the empty string.
+   *   optional string bar = 2 [
+   *     (buf.validate.field).string.uri = true,
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+   *   ];
+   *
+   *   // IGNORE_IF_DEFAULT_VALUE is equivalent to IGNORE_IF_UNPOPULATED in
+   *   // this case; the min_items rule only applies if the list has at least
+   *   // one item.
+   *   repeated string baz = 3 [
+   *     (buf.validate.field).repeated.min_items = 3,
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+   *   ];
+   *
+   *   // The custom CEL rule only applies if the field is set to a value other
+   *   // than an empty message (i.e., fields are unpopulated).
+   *   SomeMessage quux = 4 [
+   *     (buf.validate.field).cel = {/* ... */},
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+   *   ];
+   * }
+   * ```
+   *
+   * This rule is affected by proto2 custom default values:
+   *
+   * ```proto
+   * syntax="proto2";
+   *
+   * message Request {
+   *   // The gt rule only applies if the field is set and it's value is not
+   *   the default (i.e., not -42). The rule even applies if the field is set
+   *   to zero since the default value differs.
+   *   optional int32 value = 1 [
+   *     default = -42,
+   *     (buf.validate.field).int32.gt = 0,
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+   *   ];
+   * }
+   * 
+ * + * IGNORE_IF_DEFAULT_VALUE = 2; + */ + IGNORE_IF_DEFAULT_VALUE(2), + /** + *
+   * The validation rules of this field will be skipped and not evaluated. This
+   * is useful for situations that necessitate turning off the rules of a field
+   * containing a message that may not make sense in the current context, or to
+   * temporarily disable constraints during development.
+   *
+   * ```proto
+   * message MyMessage {
+   *   // The field's rules will always be ignored, including any validation's
+   *   // on value's fields.
+   *   MyOtherMessage value = 1 [
+   *     (buf.validate.field).ignore = IGNORE_ALWAYS];
+   * }
+   * ```
+   * 
+ * + * IGNORE_ALWAYS = 3; + */ + IGNORE_ALWAYS(3), + UNRECOGNIZED(-1), + ; + + /** + *
+   * Deprecated: Use IGNORE_IF_UNPOPULATED instead. TODO: Remove this value pre-v1.
+   * 
+ * + * IGNORE_EMPTY = 1 [deprecated = true]; + */ + public static final Ignore IGNORE_EMPTY = IGNORE_IF_UNPOPULATED; + /** + *
+   * Deprecated: Use IGNORE_IF_DEFAULT_VALUE. TODO: Remove this value pre-v1.
+   * 
+ * + * IGNORE_DEFAULT = 2 [deprecated = true]; + */ + public static final Ignore IGNORE_DEFAULT = IGNORE_IF_DEFAULT_VALUE; + /** + *
+   * Validation is only skipped if it's an unpopulated nullable fields.
+   *
+   * ```proto
+   * syntax="proto3";
+   *
+   * message Request {
+   *   // The uri rule applies to any value, including the empty string.
+   *   string foo = 1 [
+   *     (buf.validate.field).string.uri = true
+   *   ];
+   *
+   *   // The uri rule only applies if the field is set, including if it's
+   *   // set to the empty string.
+   *   optional string bar = 2 [
+   *     (buf.validate.field).string.uri = true
+   *   ];
+   *
+   *   // The min_items rule always applies, even if the list is empty.
+   *   repeated string baz = 3 [
+   *     (buf.validate.field).repeated.min_items = 3
+   *   ];
+   *
+   *   // The custom CEL rule applies only if the field is set, including if
+   *   // it's the "zero" value of that message.
+   *   SomeMessage quux = 4 [
+   *     (buf.validate.field).cel = {/* ... */}
+   *   ];
+   * }
+   * ```
+   * 
+ * + * IGNORE_UNSPECIFIED = 0; + */ + public static final int IGNORE_UNSPECIFIED_VALUE = 0; + /** + *
+   * Validation is skipped if the field is unpopulated. This rule is redundant
+   * if the field is already nullable. This value is equivalent behavior to the
+   * deprecated ignore_empty rule.
+   *
+   * ```proto
+   * syntax="proto3
+   *
+   * message Request {
+   *   // The uri rule applies only if the value is not the empty string.
+   *   string foo = 1 [
+   *     (buf.validate.field).string.uri = true,
+   *     (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
+   *   ];
+   *
+   *   // IGNORE_IF_UNPOPULATED is equivalent to IGNORE_UNSPECIFIED in this
+   *   // case: the uri rule only applies if the field is set, including if
+   *   // it's set to the empty string.
+   *   optional string bar = 2 [
+   *     (buf.validate.field).string.uri = true,
+   *     (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
+   *   ];
+   *
+   *   // The min_items rule only applies if the list has at least one item.
+   *   repeated string baz = 3 [
+   *     (buf.validate.field).repeated.min_items = 3,
+   *     (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
+   *   ];
+   *
+   *   // IGNORE_IF_UNPOPULATED is equivalent to IGNORE_UNSPECIFIED in this
+   *   // case: the custom CEL rule applies only if the field is set, including
+   *   // if it's the "zero" value of that message.
+   *   SomeMessage quux = 4 [
+   *     (buf.validate.field).cel = {/* ... */},
+   *     (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
+   *   ];
+   * }
+   * ```
+   * 
+ * + * IGNORE_IF_UNPOPULATED = 1; + */ + public static final int IGNORE_IF_UNPOPULATED_VALUE = 1; + /** + *
+   * Validation is skipped if the field is unpopulated or if it is a nullable
+   * field populated with its default value. This is typically the zero or
+   * empty value, but proto2 scalars support custom defaults. For messages, the
+   * default is a non-null message with all its fields unpopulated.
+   *
+   * ```proto
+   * syntax="proto3
+   *
+   * message Request {
+   *   // IGNORE_IF_DEFAULT_VALUE is equivalent to IGNORE_IF_UNPOPULATED in
+   *   // this case; the uri rule applies only if the value is not the empty
+   *   // string.
+   *   string foo = 1 [
+   *     (buf.validate.field).string.uri = true,
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+   *   ];
+   *
+   *   // The uri rule only applies if the field is set to a value other than
+   *   // the empty string.
+   *   optional string bar = 2 [
+   *     (buf.validate.field).string.uri = true,
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+   *   ];
+   *
+   *   // IGNORE_IF_DEFAULT_VALUE is equivalent to IGNORE_IF_UNPOPULATED in
+   *   // this case; the min_items rule only applies if the list has at least
+   *   // one item.
+   *   repeated string baz = 3 [
+   *     (buf.validate.field).repeated.min_items = 3,
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+   *   ];
+   *
+   *   // The custom CEL rule only applies if the field is set to a value other
+   *   // than an empty message (i.e., fields are unpopulated).
+   *   SomeMessage quux = 4 [
+   *     (buf.validate.field).cel = {/* ... */},
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+   *   ];
+   * }
+   * ```
+   *
+   * This rule is affected by proto2 custom default values:
+   *
+   * ```proto
+   * syntax="proto2";
+   *
+   * message Request {
+   *   // The gt rule only applies if the field is set and it's value is not
+   *   the default (i.e., not -42). The rule even applies if the field is set
+   *   to zero since the default value differs.
+   *   optional int32 value = 1 [
+   *     default = -42,
+   *     (buf.validate.field).int32.gt = 0,
+   *     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+   *   ];
+   * }
+   * 
+ * + * IGNORE_IF_DEFAULT_VALUE = 2; + */ + public static final int IGNORE_IF_DEFAULT_VALUE_VALUE = 2; + /** + *
+   * The validation rules of this field will be skipped and not evaluated. This
+   * is useful for situations that necessitate turning off the rules of a field
+   * containing a message that may not make sense in the current context, or to
+   * temporarily disable constraints during development.
+   *
+   * ```proto
+   * message MyMessage {
+   *   // The field's rules will always be ignored, including any validation's
+   *   // on value's fields.
+   *   MyOtherMessage value = 1 [
+   *     (buf.validate.field).ignore = IGNORE_ALWAYS];
+   * }
+   * ```
+   * 
+ * + * IGNORE_ALWAYS = 3; + */ + public static final int IGNORE_ALWAYS_VALUE = 3; + /** + *
+   * Deprecated: Use IGNORE_IF_UNPOPULATED instead. TODO: Remove this value pre-v1.
+   * 
+ * + * IGNORE_EMPTY = 1 [deprecated = true]; + */ + @java.lang.Deprecated public static final int IGNORE_EMPTY_VALUE = 1; + /** + *
+   * Deprecated: Use IGNORE_IF_DEFAULT_VALUE. TODO: Remove this value pre-v1.
+   * 
+ * + * IGNORE_DEFAULT = 2 [deprecated = true]; + */ + @java.lang.Deprecated public static final int IGNORE_DEFAULT_VALUE = 2; + + + public final int getNumber() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalArgumentException( + "Can't get the number of an unknown enum value."); + } + return value; + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + * @deprecated Use {@link #forNumber(int)} instead. + */ + @java.lang.Deprecated + public static Ignore valueOf(int value) { + return forNumber(value); + } + + /** + * @param value The numeric wire value of the corresponding enum entry. + * @return The enum associated with the given numeric wire value. + */ + public static Ignore forNumber(int value) { + switch (value) { + case 0: return IGNORE_UNSPECIFIED; + case 1: return IGNORE_IF_UNPOPULATED; + case 2: return IGNORE_IF_DEFAULT_VALUE; + case 3: return IGNORE_ALWAYS; + default: return null; + } + } + + public static com.google.protobuf.Internal.EnumLiteMap + internalGetValueMap() { + return internalValueMap; + } + private static final com.google.protobuf.Internal.EnumLiteMap< + Ignore> internalValueMap = + new com.google.protobuf.Internal.EnumLiteMap() { + public Ignore findValueByNumber(int number) { + return Ignore.forNumber(number); + } + }; + + public final com.google.protobuf.Descriptors.EnumValueDescriptor + getValueDescriptor() { + if (this == UNRECOGNIZED) { + throw new java.lang.IllegalStateException( + "Can't get the descriptor of an unrecognized enum value."); + } + return getDescriptor().getValues().get(ordinal()); + } + public final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptorForType() { + return getDescriptor(); + } + public static final com.google.protobuf.Descriptors.EnumDescriptor + getDescriptor() { + return build.buf.validate.ValidateProto.getDescriptor().getEnumTypes().get(0); + } + + private static final Ignore[] VALUES = getStaticValuesArray(); + private static Ignore[] getStaticValuesArray() { + return new Ignore[] { + IGNORE_UNSPECIFIED, IGNORE_IF_UNPOPULATED, IGNORE_IF_DEFAULT_VALUE, IGNORE_ALWAYS, IGNORE_EMPTY, IGNORE_DEFAULT, + }; + } + public static Ignore valueOf( + com.google.protobuf.Descriptors.EnumValueDescriptor desc) { + if (desc.getType() != getDescriptor()) { + throw new java.lang.IllegalArgumentException( + "EnumValueDescriptor is not for this type."); + } + if (desc.getIndex() == -1) { + return UNRECOGNIZED; + } + return VALUES[desc.getIndex()]; + } + + private final int value; + + private Ignore(int value) { + this.value = value; + } + + // @@protoc_insertion_point(enum_scope:buf.validate.Ignore) +} + diff --git a/src/main/java/build/buf/validate/KnownRegex.java b/src/main/java/build/buf/validate/KnownRegex.java index f7fc1c8b..1bf6579a 100644 --- a/src/main/java/build/buf/validate/KnownRegex.java +++ b/src/main/java/build/buf/validate/KnownRegex.java @@ -115,7 +115,7 @@ public KnownRegex findValueByNumber(int number) { } public static final com.google.protobuf.Descriptors.EnumDescriptor getDescriptor() { - return build.buf.validate.ValidateProto.getDescriptor().getEnumTypes().get(0); + return build.buf.validate.ValidateProto.getDescriptor().getEnumTypes().get(1); } private static final KnownRegex[] VALUES = values(); diff --git a/src/main/java/build/buf/validate/StringRules.java b/src/main/java/build/buf/validate/StringRules.java index f7e94bcb..09782393 100644 --- a/src/main/java/build/buf/validate/StringRules.java +++ b/src/main/java/build/buf/validate/StringRules.java @@ -76,6 +76,7 @@ public enum WellKnownCase IP_PREFIX(29), IPV4_PREFIX(30), IPV6_PREFIX(31), + HOST_AND_PORT(32), WELL_KNOWN_REGEX(24), WELLKNOWN_NOT_SET(0); private final int value; @@ -109,6 +110,7 @@ public static WellKnownCase forNumber(int value) { case 29: return IP_PREFIX; case 30: return IPV4_PREFIX; case 31: return IPV6_PREFIX; + case 32: return HOST_AND_PORT; case 24: return WELL_KNOWN_REGEX; case 0: return WELLKNOWN_NOT_SET; default: return null; @@ -1586,7 +1588,7 @@ public boolean getIpWithPrefixlen() { * * ```proto * message MyString { - * // value must be a valid IPv4 address with prefix lentgh + * // value must be a valid IPv4 address with prefix length * string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; * } * ``` @@ -1608,7 +1610,7 @@ public boolean hasIpv4WithPrefixlen() { * * ```proto * message MyString { - * // value must be a valid IPv4 address with prefix lentgh + * // value must be a valid IPv4 address with prefix length * string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true]; * } * ``` @@ -1821,6 +1823,41 @@ public boolean getIpv6Prefix() { return false; } + public static final int HOST_AND_PORT_FIELD_NUMBER = 32; + /** + *
+   * `host_and_port` specifies the field value must be a valid host and port
+   * pair. The host must be a valid hostname or IP address while the port
+   * must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
+   * with square brackets (e.g., `[::1]:1234`).
+   * 
+ * + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * @return Whether the hostAndPort field is set. + */ + @java.lang.Override + public boolean hasHostAndPort() { + return wellKnownCase_ == 32; + } + /** + *
+   * `host_and_port` specifies the field value must be a valid host and port
+   * pair. The host must be a valid hostname or IP address while the port
+   * must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
+   * with square brackets (e.g., `[::1]:1234`).
+   * 
+ * + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * @return The hostAndPort. + */ + @java.lang.Override + public boolean getHostAndPort() { + if (wellKnownCase_ == 32) { + return (java.lang.Boolean) wellKnown_; + } + return false; + } + public static final int WELL_KNOWN_REGEX_FIELD_NUMBER = 24; /** *
@@ -1831,7 +1868,7 @@ public boolean getIpv6Prefix() {
    * ```proto
    * message MyString {
    *   // value must be a valid HTTP header value
-   *   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+   *   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
    * }
    * ```
    *
@@ -1861,7 +1898,7 @@ public boolean hasWellKnownRegex() {
    * ```proto
    * message MyString {
    *   // value must be a valid HTTP header value
-   *   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+   *   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
    * }
    * ```
    *
@@ -1894,7 +1931,7 @@ public int getWellKnownRegexValue() {
    * ```proto
    * message MyString {
    *   // value must be a valid HTTP header value
-   *   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+   *   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
    * }
    * ```
    *
@@ -2092,6 +2129,10 @@ public void writeTo(com.google.protobuf.CodedOutputStream output)
       output.writeBool(
           31, (boolean)((java.lang.Boolean) wellKnown_));
     }
+    if (wellKnownCase_ == 32) {
+      output.writeBool(
+          32, (boolean)((java.lang.Boolean) wellKnown_));
+    }
     getUnknownFields().writeTo(output);
   }
 
@@ -2242,6 +2283,11 @@ public int getSerializedSize() {
         .computeBoolSize(
             31, (boolean)((java.lang.Boolean) wellKnown_));
     }
+    if (wellKnownCase_ == 32) {
+      size += com.google.protobuf.CodedOutputStream
+        .computeBoolSize(
+            32, (boolean)((java.lang.Boolean) wellKnown_));
+    }
     size += getUnknownFields().getSerializedSize();
     memoizedSize = size;
     return size;
@@ -2388,6 +2434,10 @@ public boolean equals(final java.lang.Object obj) {
         if (getIpv6Prefix()
             != other.getIpv6Prefix()) return false;
         break;
+      case 32:
+        if (getHostAndPort()
+            != other.getHostAndPort()) return false;
+        break;
       case 24:
         if (getWellKnownRegexValue()
             != other.getWellKnownRegexValue()) return false;
@@ -2549,6 +2599,11 @@ public int hashCode() {
         hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
             getIpv6Prefix());
         break;
+      case 32:
+        hash = (37 * hash) + HOST_AND_PORT_FIELD_NUMBER;
+        hash = (53 * hash) + com.google.protobuf.Internal.hashBoolean(
+            getHostAndPort());
+        break;
       case 24:
         hash = (37 * hash) + WELL_KNOWN_REGEX_FIELD_NUMBER;
         hash = (53 * hash) + getWellKnownRegexValue();
@@ -2802,7 +2857,7 @@ private void buildPartial0(build.buf.validate.StringRules result) {
         notIn_.makeImmutable();
         result.notIn_ = notIn_;
       }
-      if (((from_bitField0_ & 0x40000000) != 0)) {
+      if (((from_bitField0_ & 0x80000000) != 0)) {
         result.strict_ = strict_;
         to_bitField0_ |= 0x00001000;
       }
@@ -2990,6 +3045,10 @@ public Builder mergeFrom(build.buf.validate.StringRules other) {
           setIpv6Prefix(other.getIpv6Prefix());
           break;
         }
+        case HOST_AND_PORT: {
+          setHostAndPort(other.getHostAndPort());
+          break;
+        }
         case WELL_KNOWN_REGEX: {
           setWellKnownRegexValue(other.getWellKnownRegexValue());
           break;
@@ -3149,7 +3208,7 @@ public Builder mergeFrom(
             } // case 192
             case 200: {
               strict_ = input.readBool();
-              bitField0_ |= 0x40000000;
+              bitField0_ |= 0x80000000;
               break;
             } // case 200
             case 208: {
@@ -3182,6 +3241,11 @@ public Builder mergeFrom(
               wellKnownCase_ = 31;
               break;
             } // case 248
+            case 256: {
+              wellKnown_ = input.readBool();
+              wellKnownCase_ = 32;
+              break;
+            } // case 256
             default: {
               if (!super.parseUnknownField(input, extensionRegistry, tag)) {
                 done = true; // was an endgroup tag
@@ -6146,7 +6210,7 @@ public Builder clearIpWithPrefixlen() {
      *
      * ```proto
      * message MyString {
-     *   // value must be a valid IPv4 address with prefix lentgh
+     *   // value must be a valid IPv4 address with prefix length
      *    string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
      * }
      * ```
@@ -6167,7 +6231,7 @@ public boolean hasIpv4WithPrefixlen() {
      *
      * ```proto
      * message MyString {
-     *   // value must be a valid IPv4 address with prefix lentgh
+     *   // value must be a valid IPv4 address with prefix length
      *    string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
      * }
      * ```
@@ -6191,7 +6255,7 @@ public boolean getIpv4WithPrefixlen() {
      *
      * ```proto
      * message MyString {
-     *   // value must be a valid IPv4 address with prefix lentgh
+     *   // value must be a valid IPv4 address with prefix length
      *    string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
      * }
      * ```
@@ -6217,7 +6281,7 @@ public Builder setIpv4WithPrefixlen(boolean value) {
      *
      * ```proto
      * message MyString {
-     *   // value must be a valid IPv4 address with prefix lentgh
+     *   // value must be a valid IPv4 address with prefix length
      *    string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
      * }
      * ```
@@ -6627,6 +6691,76 @@ public Builder clearIpv6Prefix() {
       return this;
     }
 
+    /**
+     * 
+     * `host_and_port` specifies the field value must be a valid host and port
+     * pair. The host must be a valid hostname or IP address while the port
+     * must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
+     * with square brackets (e.g., `[::1]:1234`).
+     * 
+ * + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * @return Whether the hostAndPort field is set. + */ + public boolean hasHostAndPort() { + return wellKnownCase_ == 32; + } + /** + *
+     * `host_and_port` specifies the field value must be a valid host and port
+     * pair. The host must be a valid hostname or IP address while the port
+     * must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
+     * with square brackets (e.g., `[::1]:1234`).
+     * 
+ * + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * @return The hostAndPort. + */ + public boolean getHostAndPort() { + if (wellKnownCase_ == 32) { + return (java.lang.Boolean) wellKnown_; + } + return false; + } + /** + *
+     * `host_and_port` specifies the field value must be a valid host and port
+     * pair. The host must be a valid hostname or IP address while the port
+     * must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
+     * with square brackets (e.g., `[::1]:1234`).
+     * 
+ * + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * @param value The hostAndPort to set. + * @return This builder for chaining. + */ + public Builder setHostAndPort(boolean value) { + + wellKnownCase_ = 32; + wellKnown_ = value; + onChanged(); + return this; + } + /** + *
+     * `host_and_port` specifies the field value must be a valid host and port
+     * pair. The host must be a valid hostname or IP address while the port
+     * must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
+     * with square brackets (e.g., `[::1]:1234`).
+     * 
+ * + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearHostAndPort() { + if (wellKnownCase_ == 32) { + wellKnownCase_ = 0; + wellKnown_ = null; + onChanged(); + } + return this; + } + /** *
      * `well_known_regex` specifies a common well-known pattern
@@ -6636,7 +6770,7 @@ public Builder clearIpv6Prefix() {
      * ```proto
      * message MyString {
      *   // value must be a valid HTTP header value
-     *   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+     *   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
      * }
      * ```
      *
@@ -6667,7 +6801,7 @@ public boolean hasWellKnownRegex() {
      * ```proto
      * message MyString {
      *   // value must be a valid HTTP header value
-     *   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+     *   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
      * }
      * ```
      *
@@ -6701,7 +6835,7 @@ public int getWellKnownRegexValue() {
      * ```proto
      * message MyString {
      *   // value must be a valid HTTP header value
-     *   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+     *   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
      * }
      * ```
      *
@@ -6735,7 +6869,7 @@ public Builder setWellKnownRegexValue(int value) {
      * ```proto
      * message MyString {
      *   // value must be a valid HTTP header value
-     *   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+     *   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
      * }
      * ```
      *
@@ -6771,7 +6905,7 @@ public build.buf.validate.KnownRegex getWellKnownRegex() {
      * ```proto
      * message MyString {
      *   // value must be a valid HTTP header value
-     *   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+     *   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
      * }
      * ```
      *
@@ -6808,7 +6942,7 @@ public Builder setWellKnownRegex(build.buf.validate.KnownRegex value) {
      * ```proto
      * message MyString {
      *   // value must be a valid HTTP header value
-     *   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+     *   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
      * }
      * ```
      *
@@ -6857,7 +6991,7 @@ public Builder clearWellKnownRegex() {
      */
     @java.lang.Override
     public boolean hasStrict() {
-      return ((bitField0_ & 0x40000000) != 0);
+      return ((bitField0_ & 0x80000000) != 0);
     }
     /**
      * 
@@ -6905,7 +7039,7 @@ public boolean getStrict() {
     public Builder setStrict(boolean value) {
 
       strict_ = value;
-      bitField0_ |= 0x40000000;
+      bitField0_ |= 0x80000000;
       onChanged();
       return this;
     }
@@ -6929,7 +7063,7 @@ public Builder setStrict(boolean value) {
      * @return This builder for chaining.
      */
     public Builder clearStrict() {
-      bitField0_ = (bitField0_ & ~0x40000000);
+      bitField0_ = (bitField0_ & ~0x80000000);
       strict_ = false;
       onChanged();
       return this;
diff --git a/src/main/java/build/buf/validate/StringRulesOrBuilder.java b/src/main/java/build/buf/validate/StringRulesOrBuilder.java
index ef0dd94a..6373bb98 100644
--- a/src/main/java/build/buf/validate/StringRulesOrBuilder.java
+++ b/src/main/java/build/buf/validate/StringRulesOrBuilder.java
@@ -1116,7 +1116,7 @@ public interface StringRulesOrBuilder extends
    *
    * ```proto
    * message MyString {
-   *   // value must be a valid IPv4 address with prefix lentgh
+   *   // value must be a valid IPv4 address with prefix length
    *    string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
    * }
    * ```
@@ -1135,7 +1135,7 @@ public interface StringRulesOrBuilder extends
    *
    * ```proto
    * message MyString {
-   *   // value must be a valid IPv4 address with prefix lentgh
+   *   // value must be a valid IPv4 address with prefix length
    *    string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
    * }
    * ```
@@ -1302,6 +1302,31 @@ public interface StringRulesOrBuilder extends
    */
   boolean getIpv6Prefix();
 
+  /**
+   * 
+   * `host_and_port` specifies the field value must be a valid host and port
+   * pair. The host must be a valid hostname or IP address while the port
+   * must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
+   * with square brackets (e.g., `[::1]:1234`).
+   * 
+ * + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * @return Whether the hostAndPort field is set. + */ + boolean hasHostAndPort(); + /** + *
+   * `host_and_port` specifies the field value must be a valid host and port
+   * pair. The host must be a valid hostname or IP address while the port
+   * must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
+   * with square brackets (e.g., `[::1]:1234`).
+   * 
+ * + * bool host_and_port = 32 [json_name = "hostAndPort", (.buf.validate.priv.field) = { ... } + * @return The hostAndPort. + */ + boolean getHostAndPort(); + /** *
    * `well_known_regex` specifies a common well-known pattern
@@ -1311,7 +1336,7 @@ public interface StringRulesOrBuilder extends
    * ```proto
    * message MyString {
    *   // value must be a valid HTTP header value
-   *   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+   *   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
    * }
    * ```
    *
@@ -1339,7 +1364,7 @@ public interface StringRulesOrBuilder extends
    * ```proto
    * message MyString {
    *   // value must be a valid HTTP header value
-   *   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+   *   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
    * }
    * ```
    *
@@ -1367,7 +1392,7 @@ public interface StringRulesOrBuilder extends
    * ```proto
    * message MyString {
    *   // value must be a valid HTTP header value
-   *   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+   *   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
    * }
    * ```
    *
diff --git a/src/main/java/build/buf/validate/ValidateProto.java b/src/main/java/build/buf/validate/ValidateProto.java
index b3bbc535..a0b0795e 100644
--- a/src/main/java/build/buf/validate/ValidateProto.java
+++ b/src/main/java/build/buf/validate/ValidateProto.java
@@ -204,1228 +204,1289 @@ public static void registerAllExtensions(
       "\030\001 \001(\010H\000R\010disabled\210\001\001\022*\n\003cel\030\003 \003(\0132\030.buf" +
       ".validate.ConstraintR\003celB\013\n\t_disabled\"@" +
       "\n\020OneofConstraints\022\037\n\010required\030\001 \001(\010H\000R\010" +
-      "required\210\001\001B\013\n\t_required\"\365\t\n\020FieldConstr" +
+      "required\210\001\001B\013\n\t_required\"\253\n\n\020FieldConstr" +
       "aints\022*\n\003cel\030\027 \003(\0132\030.buf.validate.Constr" +
-      "aintR\003cel\022\030\n\007skipped\030\030 \001(\010R\007skipped\022\032\n\010r" +
-      "equired\030\031 \001(\010R\010required\022!\n\014ignore_empty\030" +
-      "\032 \001(\010R\013ignoreEmpty\0220\n\005float\030\001 \001(\0132\030.buf." +
-      "validate.FloatRulesH\000R\005float\0223\n\006double\030\002" +
-      " \001(\0132\031.buf.validate.DoubleRulesH\000R\006doubl" +
-      "e\0220\n\005int32\030\003 \001(\0132\030.buf.validate.Int32Rul" +
-      "esH\000R\005int32\0220\n\005int64\030\004 \001(\0132\030.buf.validat" +
-      "e.Int64RulesH\000R\005int64\0223\n\006uint32\030\005 \001(\0132\031." +
-      "buf.validate.UInt32RulesH\000R\006uint32\0223\n\006ui" +
-      "nt64\030\006 \001(\0132\031.buf.validate.UInt64RulesH\000R" +
-      "\006uint64\0223\n\006sint32\030\007 \001(\0132\031.buf.validate.S" +
-      "Int32RulesH\000R\006sint32\0223\n\006sint64\030\010 \001(\0132\031.b" +
-      "uf.validate.SInt64RulesH\000R\006sint64\0226\n\007fix" +
-      "ed32\030\t \001(\0132\032.buf.validate.Fixed32RulesH\000" +
-      "R\007fixed32\0226\n\007fixed64\030\n \001(\0132\032.buf.validat" +
-      "e.Fixed64RulesH\000R\007fixed64\0229\n\010sfixed32\030\013 " +
-      "\001(\0132\033.buf.validate.SFixed32RulesH\000R\010sfix" +
-      "ed32\0229\n\010sfixed64\030\014 \001(\0132\033.buf.validate.SF" +
-      "ixed64RulesH\000R\010sfixed64\022-\n\004bool\030\r \001(\0132\027." +
-      "buf.validate.BoolRulesH\000R\004bool\0223\n\006string" +
-      "\030\016 \001(\0132\031.buf.validate.StringRulesH\000R\006str" +
-      "ing\0220\n\005bytes\030\017 \001(\0132\030.buf.validate.BytesR" +
-      "ulesH\000R\005bytes\022-\n\004enum\030\020 \001(\0132\027.buf.valida" +
-      "te.EnumRulesH\000R\004enum\0229\n\010repeated\030\022 \001(\0132\033" +
-      ".buf.validate.RepeatedRulesH\000R\010repeated\022" +
-      "*\n\003map\030\023 \001(\0132\026.buf.validate.MapRulesH\000R\003" +
-      "map\022*\n\003any\030\024 \001(\0132\026.buf.validate.AnyRules" +
-      "H\000R\003any\0229\n\010duration\030\025 \001(\0132\033.buf.validate" +
-      ".DurationRulesH\000R\010duration\022<\n\ttimestamp\030" +
-      "\026 \001(\0132\034.buf.validate.TimestampRulesH\000R\tt" +
-      "imestampB\006\n\004type\"\242\027\n\nFloatRules\022u\n\005const" +
-      "\030\001 \001(\002BZ\302HW\nU\n\013float.const\032Fthis != rule" +
-      "s.const ? \'value must equal %s\'.format([" +
-      "rules.const]) : \'\'H\002R\005const\210\001\001\022\243\001\n\002lt\030\002 " +
-      "\001(\002B\220\001\302H\214\001\n\211\001\n\010float.lt\032}!has(rules.gte)" +
-      " && !has(rules.gt) && (this.isNan() || t" +
-      "his >= rules.lt)? \'value must be less th" +
-      "an %s\'.format([rules.lt]) : \'\'H\000R\002lt\022\264\001\n" +
-      "\003lte\030\003 \001(\002B\237\001\302H\233\001\n\230\001\n\tfloat.lte\032\212\001!has(r" +
-      "ules.gte) && !has(rules.gt) && (this.isN" +
-      "an() || this > rules.lte)? \'value must b" +
-      "e less than or equal to %s\'.format([rule" +
-      "s.lte]) : \'\'H\000R\003lte\022\363\007\n\002gt\030\004 \001(\002B\340\007\302H\334\007\n" +
-      "\215\001\n\010float.gt\032\200\001!has(rules.lt) && !has(ru" +
+      "aintR\003cel\022\032\n\010required\030\031 \001(\010R\010required\022,\n" +
+      "\006ignore\030\033 \001(\0162\024.buf.validate.IgnoreR\006ign" +
+      "ore\0220\n\005float\030\001 \001(\0132\030.buf.validate.FloatR" +
+      "ulesH\000R\005float\0223\n\006double\030\002 \001(\0132\031.buf.vali" +
+      "date.DoubleRulesH\000R\006double\0220\n\005int32\030\003 \001(" +
+      "\0132\030.buf.validate.Int32RulesH\000R\005int32\0220\n\005" +
+      "int64\030\004 \001(\0132\030.buf.validate.Int64RulesH\000R" +
+      "\005int64\0223\n\006uint32\030\005 \001(\0132\031.buf.validate.UI" +
+      "nt32RulesH\000R\006uint32\0223\n\006uint64\030\006 \001(\0132\031.bu" +
+      "f.validate.UInt64RulesH\000R\006uint64\0223\n\006sint" +
+      "32\030\007 \001(\0132\031.buf.validate.SInt32RulesH\000R\006s" +
+      "int32\0223\n\006sint64\030\010 \001(\0132\031.buf.validate.SIn" +
+      "t64RulesH\000R\006sint64\0226\n\007fixed32\030\t \001(\0132\032.bu" +
+      "f.validate.Fixed32RulesH\000R\007fixed32\0226\n\007fi" +
+      "xed64\030\n \001(\0132\032.buf.validate.Fixed64RulesH" +
+      "\000R\007fixed64\0229\n\010sfixed32\030\013 \001(\0132\033.buf.valid" +
+      "ate.SFixed32RulesH\000R\010sfixed32\0229\n\010sfixed6" +
+      "4\030\014 \001(\0132\033.buf.validate.SFixed64RulesH\000R\010" +
+      "sfixed64\022-\n\004bool\030\r \001(\0132\027.buf.validate.Bo" +
+      "olRulesH\000R\004bool\0223\n\006string\030\016 \001(\0132\031.buf.va" +
+      "lidate.StringRulesH\000R\006string\0220\n\005bytes\030\017 " +
+      "\001(\0132\030.buf.validate.BytesRulesH\000R\005bytes\022-" +
+      "\n\004enum\030\020 \001(\0132\027.buf.validate.EnumRulesH\000R" +
+      "\004enum\0229\n\010repeated\030\022 \001(\0132\033.buf.validate.R" +
+      "epeatedRulesH\000R\010repeated\022*\n\003map\030\023 \001(\0132\026." +
+      "buf.validate.MapRulesH\000R\003map\022*\n\003any\030\024 \001(" +
+      "\0132\026.buf.validate.AnyRulesH\000R\003any\0229\n\010dura" +
+      "tion\030\025 \001(\0132\033.buf.validate.DurationRulesH" +
+      "\000R\010duration\022<\n\ttimestamp\030\026 \001(\0132\034.buf.val" +
+      "idate.TimestampRulesH\000R\ttimestamp\022\034\n\007ski" +
+      "pped\030\030 \001(\010B\002\030\001R\007skipped\022%\n\014ignore_empty\030" +
+      "\032 \001(\010B\002\030\001R\013ignoreEmptyB\006\n\004type\"\242\027\n\nFloat" +
+      "Rules\022u\n\005const\030\001 \001(\002BZ\302HW\nU\n\013float.const" +
+      "\032Fthis != rules.const ? \'value must equa" +
+      "l %s\'.format([rules.const]) : \'\'H\002R\005cons" +
+      "t\210\001\001\022\243\001\n\002lt\030\002 \001(\002B\220\001\302H\214\001\n\211\001\n\010float.lt\032}!" +
+      "has(rules.gte) && !has(rules.gt) && (thi" +
+      "s.isNan() || this >= rules.lt)? \'value m" +
+      "ust be less than %s\'.format([rules.lt]) " +
+      ": \'\'H\000R\002lt\022\264\001\n\003lte\030\003 \001(\002B\237\001\302H\233\001\n\230\001\n\tfloa" +
+      "t.lte\032\212\001!has(rules.gte) && !has(rules.gt" +
+      ") && (this.isNan() || this > rules.lte)?" +
+      " \'value must be less than or equal to %s" +
+      "\'.format([rules.lte]) : \'\'H\000R\003lte\022\363\007\n\002gt" +
+      "\030\004 \001(\002B\340\007\302H\334\007\n\215\001\n\010float.gt\032\200\001!has(rules." +
+      "lt) && !has(rules.lte) && (this.isNan() " +
+      "|| this <= rules.gt)? \'value must be gre" +
+      "ater than %s\'.format([rules.gt]) : \'\'\n\303\001" +
+      "\n\013float.gt_lt\032\263\001has(rules.lt) && rules.l" +
+      "t >= rules.gt && (this.isNan() || this >" +
+      "= rules.lt || this <= rules.gt)? \'value " +
+      "must be greater than %s and less than %s" +
+      "\'.format([rules.gt, rules.lt]) : \'\'\n\315\001\n\025" +
+      "float.gt_lt_exclusive\032\263\001has(rules.lt) &&" +
+      " rules.lt < rules.gt && (this.isNan() ||" +
+      " (rules.lt <= this && this <= rules.gt))" +
+      "? \'value must be greater than %s or less" +
+      " than %s\'.format([rules.gt, rules.lt]) :" +
+      " \'\'\n\323\001\n\014float.gt_lte\032\302\001has(rules.lte) &&" +
+      " rules.lte >= rules.gt && (this.isNan() " +
+      "|| this > rules.lte || this <= rules.gt)" +
+      "? \'value must be greater than %s and les" +
+      "s than or equal to %s\'.format([rules.gt," +
+      " rules.lte]) : \'\'\n\335\001\n\026float.gt_lte_exclu" +
+      "sive\032\302\001has(rules.lte) && rules.lte < rul" +
+      "es.gt && (this.isNan() || (rules.lte < t" +
+      "his && this <= rules.gt))? \'value must b" +
+      "e greater than %s or less than or equal " +
+      "to %s\'.format([rules.gt, rules.lte]) : \'" +
+      "\'H\001R\002gt\022\277\010\n\003gte\030\005 \001(\002B\252\010\302H\246\010\n\233\001\n\tfloat.g" +
+      "te\032\215\001!has(rules.lt) && !has(rules.lte) &" +
+      "& (this.isNan() || this < rules.gte)? \'v" +
+      "alue must be greater than or equal to %s" +
+      "\'.format([rules.gte]) : \'\'\n\322\001\n\014float.gte" +
+      "_lt\032\301\001has(rules.lt) && rules.lt >= rules" +
+      ".gte && (this.isNan() || this >= rules.l" +
+      "t || this < rules.gte)? \'value must be g" +
+      "reater than or equal to %s and less than" +
+      " %s\'.format([rules.gte, rules.lt]) : \'\'\n" +
+      "\334\001\n\026float.gte_lt_exclusive\032\301\001has(rules.l" +
+      "t) && rules.lt < rules.gte && (this.isNa" +
+      "n() || (rules.lt <= this && this < rules" +
+      ".gte))? \'value must be greater than or e" +
+      "qual to %s or less than %s\'.format([rule" +
+      "s.gte, rules.lt]) : \'\'\n\342\001\n\rfloat.gte_lte" +
+      "\032\320\001has(rules.lte) && rules.lte >= rules." +
+      "gte && (this.isNan() || this > rules.lte" +
+      " || this < rules.gte)? \'value must be gr" +
+      "eater than or equal to %s and less than " +
+      "or equal to %s\'.format([rules.gte, rules" +
+      ".lte]) : \'\'\n\354\001\n\027float.gte_lte_exclusive\032" +
+      "\320\001has(rules.lte) && rules.lte < rules.gt" +
+      "e && (this.isNan() || (rules.lte < this " +
+      "&& this < rules.gte))? \'value must be gr" +
+      "eater than or equal to %s or less than o" +
+      "r equal to %s\'.format([rules.gte, rules." +
+      "lte]) : \'\'H\001R\003gte\022y\n\002in\030\006 \003(\002Bi\302Hf\nd\n\010fl" +
+      "oat.in\032X!(this in dyn(rules)[\'in\']) ? \'v" +
+      "alue must be in list %s\'.format([dyn(rul" +
+      "es)[\'in\']]) : \'\'R\002in\022}\n\006not_in\030\007 \003(\002Bf\302H" +
+      "c\na\n\014float.not_in\032Qthis in rules.not_in " +
+      "? \'value must not be in list %s\'.format(" +
+      "[rules.not_in]) : \'\'R\005notIn\022g\n\006finite\030\010 " +
+      "\001(\010BO\302HL\nJ\n\014float.finite\032:this.isNan() |" +
+      "| this.isInf() ? \'value must be finite\' " +
+      ": \'\'R\006finiteB\013\n\tless_thanB\016\n\014greater_tha" +
+      "nB\010\n\006_const\"\263\027\n\013DoubleRules\022v\n\005const\030\001 \001" +
+      "(\001B[\302HX\nV\n\014double.const\032Fthis != rules.c" +
+      "onst ? \'value must equal %s\'.format([rul" +
+      "es.const]) : \'\'H\002R\005const\210\001\001\022\244\001\n\002lt\030\002 \001(\001" +
+      "B\221\001\302H\215\001\n\212\001\n\tdouble.lt\032}!has(rules.gte) &" +
+      "& !has(rules.gt) && (this.isNan() || thi" +
+      "s >= rules.lt)? \'value must be less than" +
+      " %s\'.format([rules.lt]) : \'\'H\000R\002lt\022\265\001\n\003l" +
+      "te\030\003 \001(\001B\240\001\302H\234\001\n\231\001\n\ndouble.lte\032\212\001!has(ru" +
+      "les.gte) && !has(rules.gt) && (this.isNa" +
+      "n() || this > rules.lte)? \'value must be" +
+      " less than or equal to %s\'.format([rules" +
+      ".lte]) : \'\'H\000R\003lte\022\370\007\n\002gt\030\004 \001(\001B\345\007\302H\341\007\n\216" +
+      "\001\n\tdouble.gt\032\200\001!has(rules.lt) && !has(ru" +
       "les.lte) && (this.isNan() || this <= rul" +
       "es.gt)? \'value must be greater than %s\'." +
-      "format([rules.gt]) : \'\'\n\303\001\n\013float.gt_lt\032" +
-      "\263\001has(rules.lt) && rules.lt >= rules.gt " +
-      "&& (this.isNan() || this >= rules.lt || " +
-      "this <= rules.gt)? \'value must be greate" +
-      "r than %s and less than %s\'.format([rule" +
-      "s.gt, rules.lt]) : \'\'\n\315\001\n\025float.gt_lt_ex" +
-      "clusive\032\263\001has(rules.lt) && rules.lt < ru" +
-      "les.gt && (this.isNan() || (rules.lt <= " +
-      "this && this <= rules.gt))? \'value must " +
-      "be greater than %s or less than %s\'.form" +
-      "at([rules.gt, rules.lt]) : \'\'\n\323\001\n\014float." +
-      "gt_lte\032\302\001has(rules.lte) && rules.lte >= " +
-      "rules.gt && (this.isNan() || this > rule" +
-      "s.lte || this <= rules.gt)? \'value must " +
-      "be greater than %s and less than or equa" +
-      "l to %s\'.format([rules.gt, rules.lte]) :" +
-      " \'\'\n\335\001\n\026float.gt_lte_exclusive\032\302\001has(rul" +
-      "es.lte) && rules.lte < rules.gt && (this" +
-      ".isNan() || (rules.lte < this && this <=" +
-      " rules.gt))? \'value must be greater than" +
-      " %s or less than or equal to %s\'.format(" +
-      "[rules.gt, rules.lte]) : \'\'H\001R\002gt\022\277\010\n\003gt" +
-      "e\030\005 \001(\002B\252\010\302H\246\010\n\233\001\n\tfloat.gte\032\215\001!has(rule" +
-      "s.lt) && !has(rules.lte) && (this.isNan(" +
-      ") || this < rules.gte)? \'value must be g" +
-      "reater than or equal to %s\'.format([rule" +
-      "s.gte]) : \'\'\n\322\001\n\014float.gte_lt\032\301\001has(rule" +
-      "s.lt) && rules.lt >= rules.gte && (this." +
-      "isNan() || this >= rules.lt || this < ru" +
-      "les.gte)? \'value must be greater than or" +
-      " equal to %s and less than %s\'.format([r" +
-      "ules.gte, rules.lt]) : \'\'\n\334\001\n\026float.gte_" +
-      "lt_exclusive\032\301\001has(rules.lt) && rules.lt" +
-      " < rules.gte && (this.isNan() || (rules." +
-      "lt <= this && this < rules.gte))? \'value" +
-      " must be greater than or equal to %s or " +
-      "less than %s\'.format([rules.gte, rules.l" +
-      "t]) : \'\'\n\342\001\n\rfloat.gte_lte\032\320\001has(rules.l" +
-      "te) && rules.lte >= rules.gte && (this.i" +
-      "sNan() || this > rules.lte || this < rul" +
-      "es.gte)? \'value must be greater than or " +
-      "equal to %s and less than or equal to %s" +
-      "\'.format([rules.gte, rules.lte]) : \'\'\n\354\001" +
-      "\n\027float.gte_lte_exclusive\032\320\001has(rules.lt" +
-      "e) && rules.lte < rules.gte && (this.isN" +
-      "an() || (rules.lte < this && this < rule" +
-      "s.gte))? \'value must be greater than or " +
-      "equal to %s or less than or equal to %s\'" +
-      ".format([rules.gte, rules.lte]) : \'\'H\001R\003" +
-      "gte\022y\n\002in\030\006 \003(\002Bi\302Hf\nd\n\010float.in\032X!(this" +
-      " in dyn(rules)[\'in\']) ? \'value must be i" +
-      "n list %s\'.format([dyn(rules)[\'in\']]) : " +
-      "\'\'R\002in\022}\n\006not_in\030\007 \003(\002Bf\302Hc\na\n\014float.not" +
-      "_in\032Qthis in rules.not_in ? \'value must " +
-      "not be in list %s\'.format([rules.not_in]" +
-      ") : \'\'R\005notIn\022g\n\006finite\030\010 \001(\010BO\302HL\nJ\n\014fl" +
-      "oat.finite\032:this.isNan() || this.isInf()" +
-      " ? \'value must be finite\' : \'\'R\006finiteB\013" +
-      "\n\tless_thanB\016\n\014greater_thanB\010\n\006_const\"\263\027" +
-      "\n\013DoubleRules\022v\n\005const\030\001 \001(\001B[\302HX\nV\n\014dou" +
-      "ble.const\032Fthis != rules.const ? \'value " +
-      "must equal %s\'.format([rules.const]) : \'" +
-      "\'H\002R\005const\210\001\001\022\244\001\n\002lt\030\002 \001(\001B\221\001\302H\215\001\n\212\001\n\tdo" +
-      "uble.lt\032}!has(rules.gte) && !has(rules.g" +
-      "t) && (this.isNan() || this >= rules.lt)" +
-      "? \'value must be less than %s\'.format([r" +
-      "ules.lt]) : \'\'H\000R\002lt\022\265\001\n\003lte\030\003 \001(\001B\240\001\302H\234" +
-      "\001\n\231\001\n\ndouble.lte\032\212\001!has(rules.gte) && !h" +
-      "as(rules.gt) && (this.isNan() || this > " +
-      "rules.lte)? \'value must be less than or " +
-      "equal to %s\'.format([rules.lte]) : \'\'H\000R" +
-      "\003lte\022\370\007\n\002gt\030\004 \001(\001B\345\007\302H\341\007\n\216\001\n\tdouble.gt\032\200" +
-      "\001!has(rules.lt) && !has(rules.lte) && (t" +
-      "his.isNan() || this <= rules.gt)? \'value" +
-      " must be greater than %s\'.format([rules." +
-      "gt]) : \'\'\n\304\001\n\014double.gt_lt\032\263\001has(rules.l" +
-      "t) && rules.lt >= rules.gt && (this.isNa" +
-      "n() || this >= rules.lt || this <= rules" +
-      ".gt)? \'value must be greater than %s and" +
-      " less than %s\'.format([rules.gt, rules.l" +
-      "t]) : \'\'\n\316\001\n\026double.gt_lt_exclusive\032\263\001ha" +
-      "s(rules.lt) && rules.lt < rules.gt && (t" +
-      "his.isNan() || (rules.lt <= this && this" +
-      " <= rules.gt))? \'value must be greater t" +
-      "han %s or less than %s\'.format([rules.gt" +
-      ", rules.lt]) : \'\'\n\324\001\n\rdouble.gt_lte\032\302\001ha" +
-      "s(rules.lte) && rules.lte >= rules.gt &&" +
+      "format([rules.gt]) : \'\'\n\304\001\n\014double.gt_lt" +
+      "\032\263\001has(rules.lt) && rules.lt >= rules.gt" +
+      " && (this.isNan() || this >= rules.lt ||" +
+      " this <= rules.gt)? \'value must be great" +
+      "er than %s and less than %s\'.format([rul" +
+      "es.gt, rules.lt]) : \'\'\n\316\001\n\026double.gt_lt_" +
+      "exclusive\032\263\001has(rules.lt) && rules.lt < " +
+      "rules.gt && (this.isNan() || (rules.lt <" +
+      "= this && this <= rules.gt))? \'value mus" +
+      "t be greater than %s or less than %s\'.fo" +
+      "rmat([rules.gt, rules.lt]) : \'\'\n\324\001\n\rdoub" +
+      "le.gt_lte\032\302\001has(rules.lte) && rules.lte " +
+      ">= rules.gt && (this.isNan() || this > r" +
+      "ules.lte || this <= rules.gt)? \'value mu" +
+      "st be greater than %s and less than or e" +
+      "qual to %s\'.format([rules.gt, rules.lte]" +
+      ") : \'\'\n\336\001\n\027double.gt_lte_exclusive\032\302\001has" +
+      "(rules.lte) && rules.lte < rules.gt && (" +
+      "this.isNan() || (rules.lte < this && thi" +
+      "s <= rules.gt))? \'value must be greater " +
+      "than %s or less than or equal to %s\'.for" +
+      "mat([rules.gt, rules.lte]) : \'\'H\001R\002gt\022\304\010" +
+      "\n\003gte\030\005 \001(\001B\257\010\302H\253\010\n\234\001\n\ndouble.gte\032\215\001!has" +
+      "(rules.lt) && !has(rules.lte) && (this.i" +
+      "sNan() || this < rules.gte)? \'value must" +
+      " be greater than or equal to %s\'.format(" +
+      "[rules.gte]) : \'\'\n\323\001\n\rdouble.gte_lt\032\301\001ha" +
+      "s(rules.lt) && rules.lt >= rules.gte && " +
+      "(this.isNan() || this >= rules.lt || thi" +
+      "s < rules.gte)? \'value must be greater t" +
+      "han or equal to %s and less than %s\'.for" +
+      "mat([rules.gte, rules.lt]) : \'\'\n\335\001\n\027doub" +
+      "le.gte_lt_exclusive\032\301\001has(rules.lt) && r" +
+      "ules.lt < rules.gte && (this.isNan() || " +
+      "(rules.lt <= this && this < rules.gte))?" +
+      " \'value must be greater than or equal to" +
+      " %s or less than %s\'.format([rules.gte, " +
+      "rules.lt]) : \'\'\n\343\001\n\016double.gte_lte\032\320\001has" +
+      "(rules.lte) && rules.lte >= rules.gte &&" +
       " (this.isNan() || this > rules.lte || th" +
-      "is <= rules.gt)? \'value must be greater " +
-      "than %s and less than or equal to %s\'.fo" +
-      "rmat([rules.gt, rules.lte]) : \'\'\n\336\001\n\027dou" +
-      "ble.gt_lte_exclusive\032\302\001has(rules.lte) &&" +
-      " rules.lte < rules.gt && (this.isNan() |" +
-      "| (rules.lte < this && this <= rules.gt)" +
-      ")? \'value must be greater than %s or les" +
-      "s than or equal to %s\'.format([rules.gt," +
-      " rules.lte]) : \'\'H\001R\002gt\022\304\010\n\003gte\030\005 \001(\001B\257\010" +
-      "\302H\253\010\n\234\001\n\ndouble.gte\032\215\001!has(rules.lt) && " +
-      "!has(rules.lte) && (this.isNan() || this" +
-      " < rules.gte)? \'value must be greater th" +
-      "an or equal to %s\'.format([rules.gte]) :" +
-      " \'\'\n\323\001\n\rdouble.gte_lt\032\301\001has(rules.lt) &&" +
-      " rules.lt >= rules.gte && (this.isNan() " +
-      "|| this >= rules.lt || this < rules.gte)" +
-      "? \'value must be greater than or equal t" +
-      "o %s and less than %s\'.format([rules.gte" +
-      ", rules.lt]) : \'\'\n\335\001\n\027double.gte_lt_excl" +
-      "usive\032\301\001has(rules.lt) && rules.lt < rule" +
-      "s.gte && (this.isNan() || (rules.lt <= t" +
-      "his && this < rules.gte))? \'value must b" +
+      "is < rules.gte)? \'value must be greater " +
+      "than or equal to %s and less than or equ" +
+      "al to %s\'.format([rules.gte, rules.lte])" +
+      " : \'\'\n\355\001\n\030double.gte_lte_exclusive\032\320\001has" +
+      "(rules.lte) && rules.lte < rules.gte && " +
+      "(this.isNan() || (rules.lte < this && th" +
+      "is < rules.gte))? \'value must be greater" +
+      " than or equal to %s or less than or equ" +
+      "al to %s\'.format([rules.gte, rules.lte])" +
+      " : \'\'H\001R\003gte\022z\n\002in\030\006 \003(\001Bj\302Hg\ne\n\tdouble." +
+      "in\032X!(this in dyn(rules)[\'in\']) ? \'value" +
+      " must be in list %s\'.format([dyn(rules)[" +
+      "\'in\']]) : \'\'R\002in\022~\n\006not_in\030\007 \003(\001Bg\302Hd\nb\n" +
+      "\rdouble.not_in\032Qthis in rules.not_in ? \'" +
+      "value must not be in list %s\'.format([ru" +
+      "les.not_in]) : \'\'R\005notIn\022h\n\006finite\030\010 \001(\010" +
+      "BP\302HM\nK\n\rdouble.finite\032:this.isNan() || " +
+      "this.isInf() ? \'value must be finite\' : " +
+      "\'\'R\006finiteB\013\n\tless_thanB\016\n\014greater_thanB" +
+      "\010\n\006_const\"\342\024\n\nInt32Rules\022u\n\005const\030\001 \001(\005B" +
+      "Z\302HW\nU\n\013int32.const\032Fthis != rules.const" +
+      " ? \'value must equal %s\'.format([rules.c" +
+      "onst]) : \'\'H\002R\005const\210\001\001\022\216\001\n\002lt\030\002 \001(\005B|\302H" +
+      "y\nw\n\010int32.lt\032k!has(rules.gte) && !has(r" +
+      "ules.gt) && this >= rules.lt? \'value mus" +
+      "t be less than %s\'.format([rules.lt]) : " +
+      "\'\'H\000R\002lt\022\241\001\n\003lte\030\003 \001(\005B\214\001\302H\210\001\n\205\001\n\tint32." +
+      "lte\032x!has(rules.gte) && !has(rules.gt) &" +
+      "& this > rules.lte? \'value must be less " +
+      "than or equal to %s\'.format([rules.lte])" +
+      " : \'\'H\000R\003lte\022\233\007\n\002gt\030\004 \001(\005B\210\007\302H\204\007\nz\n\010int3" +
+      "2.gt\032n!has(rules.lt) && !has(rules.lte) " +
+      "&& this <= rules.gt? \'value must be grea" +
+      "ter than %s\'.format([rules.gt]) : \'\'\n\263\001\n" +
+      "\013int32.gt_lt\032\243\001has(rules.lt) && rules.lt" +
+      " >= rules.gt && (this >= rules.lt || thi" +
+      "s <= rules.gt)? \'value must be greater t" +
+      "han %s and less than %s\'.format([rules.g" +
+      "t, rules.lt]) : \'\'\n\273\001\n\025int32.gt_lt_exclu" +
+      "sive\032\241\001has(rules.lt) && rules.lt < rules" +
+      ".gt && (rules.lt <= this && this <= rule" +
+      "s.gt)? \'value must be greater than %s or" +
+      " less than %s\'.format([rules.gt, rules.l" +
+      "t]) : \'\'\n\303\001\n\014int32.gt_lte\032\262\001has(rules.lt" +
+      "e) && rules.lte >= rules.gt && (this > r" +
+      "ules.lte || this <= rules.gt)? \'value mu" +
+      "st be greater than %s and less than or e" +
+      "qual to %s\'.format([rules.gt, rules.lte]" +
+      ") : \'\'\n\313\001\n\026int32.gt_lte_exclusive\032\260\001has(" +
+      "rules.lte) && rules.lte < rules.gt && (r" +
+      "ules.lte < this && this <= rules.gt)? \'v" +
+      "alue must be greater than %s or less tha" +
+      "n or equal to %s\'.format([rules.gt, rule" +
+      "s.lte]) : \'\'H\001R\002gt\022\350\007\n\003gte\030\005 \001(\005B\323\007\302H\317\007\n" +
+      "\210\001\n\tint32.gte\032{!has(rules.lt) && !has(ru" +
+      "les.lte) && this < rules.gte? \'value mus" +
+      "t be greater than or equal to %s\'.format" +
+      "([rules.gte]) : \'\'\n\302\001\n\014int32.gte_lt\032\261\001ha" +
+      "s(rules.lt) && rules.lt >= rules.gte && " +
+      "(this >= rules.lt || this < rules.gte)? " +
+      "\'value must be greater than or equal to " +
+      "%s and less than %s\'.format([rules.gte, " +
+      "rules.lt]) : \'\'\n\312\001\n\026int32.gte_lt_exclusi" +
+      "ve\032\257\001has(rules.lt) && rules.lt < rules.g" +
+      "te && (rules.lt <= this && this < rules." +
+      "gte)? \'value must be greater than or equ" +
+      "al to %s or less than %s\'.format([rules." +
+      "gte, rules.lt]) : \'\'\n\322\001\n\rint32.gte_lte\032\300" +
+      "\001has(rules.lte) && rules.lte >= rules.gt" +
+      "e && (this > rules.lte || this < rules.g" +
+      "te)? \'value must be greater than or equa" +
+      "l to %s and less than or equal to %s\'.fo" +
+      "rmat([rules.gte, rules.lte]) : \'\'\n\332\001\n\027in" +
+      "t32.gte_lte_exclusive\032\276\001has(rules.lte) &" +
+      "& rules.lte < rules.gte && (rules.lte < " +
+      "this && this < rules.gte)? \'value must b" +
+      "e greater than or equal to %s or less th" +
+      "an or equal to %s\'.format([rules.gte, ru" +
+      "les.lte]) : \'\'H\001R\003gte\022y\n\002in\030\006 \003(\005Bi\302Hf\nd" +
+      "\n\010int32.in\032X!(this in dyn(rules)[\'in\']) " +
+      "? \'value must be in list %s\'.format([dyn" +
+      "(rules)[\'in\']]) : \'\'R\002in\022}\n\006not_in\030\007 \003(\005" +
+      "Bf\302Hc\na\n\014int32.not_in\032Qthis in rules.not" +
+      "_in ? \'value must not be in list %s\'.for" +
+      "mat([rules.not_in]) : \'\'R\005notInB\013\n\tless_" +
+      "thanB\016\n\014greater_thanB\010\n\006_const\"\342\024\n\nInt64" +
+      "Rules\022u\n\005const\030\001 \001(\003BZ\302HW\nU\n\013int64.const" +
+      "\032Fthis != rules.const ? \'value must equa" +
+      "l %s\'.format([rules.const]) : \'\'H\002R\005cons" +
+      "t\210\001\001\022\216\001\n\002lt\030\002 \001(\003B|\302Hy\nw\n\010int64.lt\032k!has" +
+      "(rules.gte) && !has(rules.gt) && this >=" +
+      " rules.lt? \'value must be less than %s\'." +
+      "format([rules.lt]) : \'\'H\000R\002lt\022\241\001\n\003lte\030\003 " +
+      "\001(\003B\214\001\302H\210\001\n\205\001\n\tint64.lte\032x!has(rules.gte" +
+      ") && !has(rules.gt) && this > rules.lte?" +
+      " \'value must be less than or equal to %s" +
+      "\'.format([rules.lte]) : \'\'H\000R\003lte\022\233\007\n\002gt" +
+      "\030\004 \001(\003B\210\007\302H\204\007\nz\n\010int64.gt\032n!has(rules.lt" +
+      ") && !has(rules.lte) && this <= rules.gt" +
+      "? \'value must be greater than %s\'.format" +
+      "([rules.gt]) : \'\'\n\263\001\n\013int64.gt_lt\032\243\001has(" +
+      "rules.lt) && rules.lt >= rules.gt && (th" +
+      "is >= rules.lt || this <= rules.gt)? \'va" +
+      "lue must be greater than %s and less tha" +
+      "n %s\'.format([rules.gt, rules.lt]) : \'\'\n" +
+      "\273\001\n\025int64.gt_lt_exclusive\032\241\001has(rules.lt" +
+      ") && rules.lt < rules.gt && (rules.lt <=" +
+      " this && this <= rules.gt)? \'value must " +
+      "be greater than %s or less than %s\'.form" +
+      "at([rules.gt, rules.lt]) : \'\'\n\303\001\n\014int64." +
+      "gt_lte\032\262\001has(rules.lte) && rules.lte >= " +
+      "rules.gt && (this > rules.lte || this <=" +
+      " rules.gt)? \'value must be greater than " +
+      "%s and less than or equal to %s\'.format(" +
+      "[rules.gt, rules.lte]) : \'\'\n\313\001\n\026int64.gt" +
+      "_lte_exclusive\032\260\001has(rules.lte) && rules" +
+      ".lte < rules.gt && (rules.lte < this && " +
+      "this <= rules.gt)? \'value must be greate" +
+      "r than %s or less than or equal to %s\'.f" +
+      "ormat([rules.gt, rules.lte]) : \'\'H\001R\002gt\022" +
+      "\350\007\n\003gte\030\005 \001(\003B\323\007\302H\317\007\n\210\001\n\tint64.gte\032{!has" +
+      "(rules.lt) && !has(rules.lte) && this < " +
+      "rules.gte? \'value must be greater than o" +
+      "r equal to %s\'.format([rules.gte]) : \'\'\n" +
+      "\302\001\n\014int64.gte_lt\032\261\001has(rules.lt) && rule" +
+      "s.lt >= rules.gte && (this >= rules.lt |" +
+      "| this < rules.gte)? \'value must be grea" +
+      "ter than or equal to %s and less than %s" +
+      "\'.format([rules.gte, rules.lt]) : \'\'\n\312\001\n" +
+      "\026int64.gte_lt_exclusive\032\257\001has(rules.lt) " +
+      "&& rules.lt < rules.gte && (rules.lt <= " +
+      "this && this < rules.gte)? \'value must b" +
       "e greater than or equal to %s or less th" +
       "an %s\'.format([rules.gte, rules.lt]) : \'" +
-      "\'\n\343\001\n\016double.gte_lte\032\320\001has(rules.lte) &&" +
-      " rules.lte >= rules.gte && (this.isNan()" +
-      " || this > rules.lte || this < rules.gte" +
-      ")? \'value must be greater than or equal " +
-      "to %s and less than or equal to %s\'.form" +
-      "at([rules.gte, rules.lte]) : \'\'\n\355\001\n\030doub" +
-      "le.gte_lte_exclusive\032\320\001has(rules.lte) &&" +
-      " rules.lte < rules.gte && (this.isNan() " +
-      "|| (rules.lte < this && this < rules.gte" +
-      "))? \'value must be greater than or equal" +
-      " to %s or less than or equal to %s\'.form" +
-      "at([rules.gte, rules.lte]) : \'\'H\001R\003gte\022z" +
-      "\n\002in\030\006 \003(\001Bj\302Hg\ne\n\tdouble.in\032X!(this in " +
-      "dyn(rules)[\'in\']) ? \'value must be in li" +
-      "st %s\'.format([dyn(rules)[\'in\']]) : \'\'R\002" +
-      "in\022~\n\006not_in\030\007 \003(\001Bg\302Hd\nb\n\rdouble.not_in" +
-      "\032Qthis in rules.not_in ? \'value must not" +
-      " be in list %s\'.format([rules.not_in]) :" +
-      " \'\'R\005notIn\022h\n\006finite\030\010 \001(\010BP\302HM\nK\n\rdoubl" +
-      "e.finite\032:this.isNan() || this.isInf() ?" +
-      " \'value must be finite\' : \'\'R\006finiteB\013\n\t" +
-      "less_thanB\016\n\014greater_thanB\010\n\006_const\"\342\024\n\n" +
-      "Int32Rules\022u\n\005const\030\001 \001(\005BZ\302HW\nU\n\013int32." +
-      "const\032Fthis != rules.const ? \'value must" +
-      " equal %s\'.format([rules.const]) : \'\'H\002R" +
-      "\005const\210\001\001\022\216\001\n\002lt\030\002 \001(\005B|\302Hy\nw\n\010int32.lt\032" +
-      "k!has(rules.gte) && !has(rules.gt) && th" +
-      "is >= rules.lt? \'value must be less than" +
-      " %s\'.format([rules.lt]) : \'\'H\000R\002lt\022\241\001\n\003l" +
-      "te\030\003 \001(\005B\214\001\302H\210\001\n\205\001\n\tint32.lte\032x!has(rule" +
-      "s.gte) && !has(rules.gt) && this > rules" +
-      ".lte? \'value must be less than or equal " +
-      "to %s\'.format([rules.lte]) : \'\'H\000R\003lte\022\233" +
-      "\007\n\002gt\030\004 \001(\005B\210\007\302H\204\007\nz\n\010int32.gt\032n!has(rul" +
-      "es.lt) && !has(rules.lte) && this <= rul" +
-      "es.gt? \'value must be greater than %s\'.f" +
-      "ormat([rules.gt]) : \'\'\n\263\001\n\013int32.gt_lt\032\243" +
-      "\001has(rules.lt) && rules.lt >= rules.gt &" +
-      "& (this >= rules.lt || this <= rules.gt)" +
-      "? \'value must be greater than %s and les" +
-      "s than %s\'.format([rules.gt, rules.lt]) " +
-      ": \'\'\n\273\001\n\025int32.gt_lt_exclusive\032\241\001has(rul" +
-      "es.lt) && rules.lt < rules.gt && (rules." +
-      "lt <= this && this <= rules.gt)? \'value " +
-      "must be greater than %s or less than %s\'" +
-      ".format([rules.gt, rules.lt]) : \'\'\n\303\001\n\014i" +
-      "nt32.gt_lte\032\262\001has(rules.lte) && rules.lt" +
-      "e >= rules.gt && (this > rules.lte || th" +
-      "is <= rules.gt)? \'value must be greater " +
-      "than %s and less than or equal to %s\'.fo" +
-      "rmat([rules.gt, rules.lte]) : \'\'\n\313\001\n\026int" +
-      "32.gt_lte_exclusive\032\260\001has(rules.lte) && " +
-      "rules.lte < rules.gt && (rules.lte < thi" +
-      "s && this <= rules.gt)? \'value must be g" +
-      "reater than %s or less than or equal to " +
-      "%s\'.format([rules.gt, rules.lte]) : \'\'H\001" +
-      "R\002gt\022\350\007\n\003gte\030\005 \001(\005B\323\007\302H\317\007\n\210\001\n\tint32.gte\032" +
-      "{!has(rules.lt) && !has(rules.lte) && th" +
-      "is < rules.gte? \'value must be greater t" +
-      "han or equal to %s\'.format([rules.gte]) " +
-      ": \'\'\n\302\001\n\014int32.gte_lt\032\261\001has(rules.lt) &&" +
-      " rules.lt >= rules.gte && (this >= rules" +
-      ".lt || this < rules.gte)? \'value must be" +
+      "\'\n\322\001\n\rint64.gte_lte\032\300\001has(rules.lte) && " +
+      "rules.lte >= rules.gte && (this > rules." +
+      "lte || this < rules.gte)? \'value must be" +
       " greater than or equal to %s and less th" +
-      "an %s\'.format([rules.gte, rules.lt]) : \'" +
-      "\'\n\312\001\n\026int32.gte_lt_exclusive\032\257\001has(rules" +
-      ".lt) && rules.lt < rules.gte && (rules.l" +
-      "t <= this && this < rules.gte)? \'value m" +
-      "ust be greater than or equal to %s or le" +
-      "ss than %s\'.format([rules.gte, rules.lt]" +
-      ") : \'\'\n\322\001\n\rint32.gte_lte\032\300\001has(rules.lte" +
-      ") && rules.lte >= rules.gte && (this > r" +
-      "ules.lte || this < rules.gte)? \'value mu" +
-      "st be greater than or equal to %s and le" +
-      "ss than or equal to %s\'.format([rules.gt" +
-      "e, rules.lte]) : \'\'\n\332\001\n\027int32.gte_lte_ex" +
-      "clusive\032\276\001has(rules.lte) && rules.lte < " +
-      "rules.gte && (rules.lte < this && this <" +
-      " rules.gte)? \'value must be greater than" +
-      " or equal to %s or less than or equal to" +
-      " %s\'.format([rules.gte, rules.lte]) : \'\'" +
-      "H\001R\003gte\022y\n\002in\030\006 \003(\005Bi\302Hf\nd\n\010int32.in\032X!(" +
-      "this in dyn(rules)[\'in\']) ? \'value must " +
-      "be in list %s\'.format([dyn(rules)[\'in\']]" +
-      ") : \'\'R\002in\022}\n\006not_in\030\007 \003(\005Bf\302Hc\na\n\014int32" +
-      ".not_in\032Qthis in rules.not_in ? \'value m" +
-      "ust not be in list %s\'.format([rules.not" +
-      "_in]) : \'\'R\005notInB\013\n\tless_thanB\016\n\014greate" +
-      "r_thanB\010\n\006_const\"\342\024\n\nInt64Rules\022u\n\005const" +
-      "\030\001 \001(\003BZ\302HW\nU\n\013int64.const\032Fthis != rule" +
-      "s.const ? \'value must equal %s\'.format([" +
-      "rules.const]) : \'\'H\002R\005const\210\001\001\022\216\001\n\002lt\030\002 " +
-      "\001(\003B|\302Hy\nw\n\010int64.lt\032k!has(rules.gte) &&" +
-      " !has(rules.gt) && this >= rules.lt? \'va" +
-      "lue must be less than %s\'.format([rules." +
-      "lt]) : \'\'H\000R\002lt\022\241\001\n\003lte\030\003 \001(\003B\214\001\302H\210\001\n\205\001\n" +
-      "\tint64.lte\032x!has(rules.gte) && !has(rule" +
-      "s.gt) && this > rules.lte? \'value must b" +
-      "e less than or equal to %s\'.format([rule" +
-      "s.lte]) : \'\'H\000R\003lte\022\233\007\n\002gt\030\004 \001(\003B\210\007\302H\204\007\n" +
-      "z\n\010int64.gt\032n!has(rules.lt) && !has(rule" +
+      "an or equal to %s\'.format([rules.gte, ru" +
+      "les.lte]) : \'\'\n\332\001\n\027int64.gte_lte_exclusi" +
+      "ve\032\276\001has(rules.lte) && rules.lte < rules" +
+      ".gte && (rules.lte < this && this < rule" +
+      "s.gte)? \'value must be greater than or e" +
+      "qual to %s or less than or equal to %s\'." +
+      "format([rules.gte, rules.lte]) : \'\'H\001R\003g" +
+      "te\022y\n\002in\030\006 \003(\003Bi\302Hf\nd\n\010int64.in\032X!(this " +
+      "in dyn(rules)[\'in\']) ? \'value must be in" +
+      " list %s\'.format([dyn(rules)[\'in\']]) : \'" +
+      "\'R\002in\022}\n\006not_in\030\007 \003(\003Bf\302Hc\na\n\014int64.not_" +
+      "in\032Qthis in rules.not_in ? \'value must n" +
+      "ot be in list %s\'.format([rules.not_in])" +
+      " : \'\'R\005notInB\013\n\tless_thanB\016\n\014greater_tha" +
+      "nB\010\n\006_const\"\362\024\n\013UInt32Rules\022v\n\005const\030\001 \001" +
+      "(\rB[\302HX\nV\n\014uint32.const\032Fthis != rules.c" +
+      "onst ? \'value must equal %s\'.format([rul" +
+      "es.const]) : \'\'H\002R\005const\210\001\001\022\217\001\n\002lt\030\002 \001(\r" +
+      "B}\302Hz\nx\n\tuint32.lt\032k!has(rules.gte) && !" +
+      "has(rules.gt) && this >= rules.lt? \'valu" +
+      "e must be less than %s\'.format([rules.lt" +
+      "]) : \'\'H\000R\002lt\022\242\001\n\003lte\030\003 \001(\rB\215\001\302H\211\001\n\206\001\n\nu" +
+      "int32.lte\032x!has(rules.gte) && !has(rules" +
+      ".gt) && this > rules.lte? \'value must be" +
+      " less than or equal to %s\'.format([rules" +
+      ".lte]) : \'\'H\000R\003lte\022\240\007\n\002gt\030\004 \001(\rB\215\007\302H\211\007\n{" +
+      "\n\tuint32.gt\032n!has(rules.lt) && !has(rule" +
       "s.lte) && this <= rules.gt? \'value must " +
       "be greater than %s\'.format([rules.gt]) :" +
-      " \'\'\n\263\001\n\013int64.gt_lt\032\243\001has(rules.lt) && r" +
-      "ules.lt >= rules.gt && (this >= rules.lt" +
-      " || this <= rules.gt)? \'value must be gr" +
-      "eater than %s and less than %s\'.format([" +
-      "rules.gt, rules.lt]) : \'\'\n\273\001\n\025int64.gt_l" +
-      "t_exclusive\032\241\001has(rules.lt) && rules.lt " +
-      "< rules.gt && (rules.lt <= this && this " +
-      "<= rules.gt)? \'value must be greater tha" +
-      "n %s or less than %s\'.format([rules.gt, " +
-      "rules.lt]) : \'\'\n\303\001\n\014int64.gt_lte\032\262\001has(r" +
+      " \'\'\n\264\001\n\014uint32.gt_lt\032\243\001has(rules.lt) && " +
+      "rules.lt >= rules.gt && (this >= rules.l" +
+      "t || this <= rules.gt)? \'value must be g" +
+      "reater than %s and less than %s\'.format(" +
+      "[rules.gt, rules.lt]) : \'\'\n\274\001\n\026uint32.gt" +
+      "_lt_exclusive\032\241\001has(rules.lt) && rules.l" +
+      "t < rules.gt && (rules.lt <= this && thi" +
+      "s <= rules.gt)? \'value must be greater t" +
+      "han %s or less than %s\'.format([rules.gt" +
+      ", rules.lt]) : \'\'\n\304\001\n\ruint32.gt_lte\032\262\001ha" +
+      "s(rules.lte) && rules.lte >= rules.gt &&" +
+      " (this > rules.lte || this <= rules.gt)?" +
+      " \'value must be greater than %s and less" +
+      " than or equal to %s\'.format([rules.gt, " +
+      "rules.lte]) : \'\'\n\314\001\n\027uint32.gt_lte_exclu" +
+      "sive\032\260\001has(rules.lte) && rules.lte < rul" +
+      "es.gt && (rules.lte < this && this <= ru" +
+      "les.gt)? \'value must be greater than %s " +
+      "or less than or equal to %s\'.format([rul" +
+      "es.gt, rules.lte]) : \'\'H\001R\002gt\022\355\007\n\003gte\030\005 " +
+      "\001(\rB\330\007\302H\324\007\n\211\001\n\nuint32.gte\032{!has(rules.lt" +
+      ") && !has(rules.lte) && this < rules.gte" +
+      "? \'value must be greater than or equal t" +
+      "o %s\'.format([rules.gte]) : \'\'\n\303\001\n\ruint3" +
+      "2.gte_lt\032\261\001has(rules.lt) && rules.lt >= " +
+      "rules.gte && (this >= rules.lt || this <" +
+      " rules.gte)? \'value must be greater than" +
+      " or equal to %s and less than %s\'.format" +
+      "([rules.gte, rules.lt]) : \'\'\n\313\001\n\027uint32." +
+      "gte_lt_exclusive\032\257\001has(rules.lt) && rule" +
+      "s.lt < rules.gte && (rules.lt <= this &&" +
+      " this < rules.gte)? \'value must be great" +
+      "er than or equal to %s or less than %s\'." +
+      "format([rules.gte, rules.lt]) : \'\'\n\323\001\n\016u" +
+      "int32.gte_lte\032\300\001has(rules.lte) && rules." +
+      "lte >= rules.gte && (this > rules.lte ||" +
+      " this < rules.gte)? \'value must be great" +
+      "er than or equal to %s and less than or " +
+      "equal to %s\'.format([rules.gte, rules.lt" +
+      "e]) : \'\'\n\333\001\n\030uint32.gte_lte_exclusive\032\276\001" +
+      "has(rules.lte) && rules.lte < rules.gte " +
+      "&& (rules.lte < this && this < rules.gte" +
+      ")? \'value must be greater than or equal " +
+      "to %s or less than or equal to %s\'.forma" +
+      "t([rules.gte, rules.lte]) : \'\'H\001R\003gte\022z\n" +
+      "\002in\030\006 \003(\rBj\302Hg\ne\n\tuint32.in\032X!(this in d" +
+      "yn(rules)[\'in\']) ? \'value must be in lis" +
+      "t %s\'.format([dyn(rules)[\'in\']]) : \'\'R\002i" +
+      "n\022~\n\006not_in\030\007 \003(\rBg\302Hd\nb\n\ruint32.not_in\032" +
+      "Qthis in rules.not_in ? \'value must not " +
+      "be in list %s\'.format([rules.not_in]) : " +
+      "\'\'R\005notInB\013\n\tless_thanB\016\n\014greater_thanB\010" +
+      "\n\006_const\"\362\024\n\013UInt64Rules\022v\n\005const\030\001 \001(\004B" +
+      "[\302HX\nV\n\014uint64.const\032Fthis != rules.cons" +
+      "t ? \'value must equal %s\'.format([rules." +
+      "const]) : \'\'H\002R\005const\210\001\001\022\217\001\n\002lt\030\002 \001(\004B}\302" +
+      "Hz\nx\n\tuint64.lt\032k!has(rules.gte) && !has" +
+      "(rules.gt) && this >= rules.lt? \'value m" +
+      "ust be less than %s\'.format([rules.lt]) " +
+      ": \'\'H\000R\002lt\022\242\001\n\003lte\030\003 \001(\004B\215\001\302H\211\001\n\206\001\n\nuint",
+      "64.lte\032x!has(rules.gte) && !has(rules.gt" +
+      ") && this > rules.lte? \'value must be le" +
+      "ss than or equal to %s\'.format([rules.lt" +
+      "e]) : \'\'H\000R\003lte\022\240\007\n\002gt\030\004 \001(\004B\215\007\302H\211\007\n{\n\tu" +
+      "int64.gt\032n!has(rules.lt) && !has(rules.l" +
+      "te) && this <= rules.gt? \'value must be " +
+      "greater than %s\'.format([rules.gt]) : \'\'" +
+      "\n\264\001\n\014uint64.gt_lt\032\243\001has(rules.lt) && rul" +
+      "es.lt >= rules.gt && (this >= rules.lt |" +
+      "| this <= rules.gt)? \'value must be grea" +
+      "ter than %s and less than %s\'.format([ru" +
+      "les.gt, rules.lt]) : \'\'\n\274\001\n\026uint64.gt_lt" +
+      "_exclusive\032\241\001has(rules.lt) && rules.lt <" +
+      " rules.gt && (rules.lt <= this && this <" +
+      "= rules.gt)? \'value must be greater than" +
+      " %s or less than %s\'.format([rules.gt, r" +
+      "ules.lt]) : \'\'\n\304\001\n\ruint64.gt_lte\032\262\001has(r" +
       "ules.lte) && rules.lte >= rules.gt && (t" +
       "his > rules.lte || this <= rules.gt)? \'v" +
       "alue must be greater than %s and less th" +
       "an or equal to %s\'.format([rules.gt, rul" +
-      "es.lte]) : \'\'\n\313\001\n\026int64.gt_lte_exclusive" +
-      "\032\260\001has(rules.lte) && rules.lte < rules.g" +
-      "t && (rules.lte < this && this <= rules." +
-      "gt)? \'value must be greater than %s or l" +
-      "ess than or equal to %s\'.format([rules.g" +
-      "t, rules.lte]) : \'\'H\001R\002gt\022\350\007\n\003gte\030\005 \001(\003B" +
-      "\323\007\302H\317\007\n\210\001\n\tint64.gte\032{!has(rules.lt) && " +
-      "!has(rules.lte) && this < rules.gte? \'va" +
-      "lue must be greater than or equal to %s\'" +
-      ".format([rules.gte]) : \'\'\n\302\001\n\014int64.gte_" +
+      "es.lte]) : \'\'\n\314\001\n\027uint64.gt_lte_exclusiv" +
+      "e\032\260\001has(rules.lte) && rules.lte < rules." +
+      "gt && (rules.lte < this && this <= rules" +
+      ".gt)? \'value must be greater than %s or " +
+      "less than or equal to %s\'.format([rules." +
+      "gt, rules.lte]) : \'\'H\001R\002gt\022\355\007\n\003gte\030\005 \001(\004" +
+      "B\330\007\302H\324\007\n\211\001\n\nuint64.gte\032{!has(rules.lt) &" +
+      "& !has(rules.lte) && this < rules.gte? \'" +
+      "value must be greater than or equal to %" +
+      "s\'.format([rules.gte]) : \'\'\n\303\001\n\ruint64.g" +
+      "te_lt\032\261\001has(rules.lt) && rules.lt >= rul" +
+      "es.gte && (this >= rules.lt || this < ru" +
+      "les.gte)? \'value must be greater than or" +
+      " equal to %s and less than %s\'.format([r" +
+      "ules.gte, rules.lt]) : \'\'\n\313\001\n\027uint64.gte" +
+      "_lt_exclusive\032\257\001has(rules.lt) && rules.l" +
+      "t < rules.gte && (rules.lt <= this && th" +
+      "is < rules.gte)? \'value must be greater " +
+      "than or equal to %s or less than %s\'.for" +
+      "mat([rules.gte, rules.lt]) : \'\'\n\323\001\n\016uint" +
+      "64.gte_lte\032\300\001has(rules.lte) && rules.lte" +
+      " >= rules.gte && (this > rules.lte || th" +
+      "is < rules.gte)? \'value must be greater " +
+      "than or equal to %s and less than or equ" +
+      "al to %s\'.format([rules.gte, rules.lte])" +
+      " : \'\'\n\333\001\n\030uint64.gte_lte_exclusive\032\276\001has" +
+      "(rules.lte) && rules.lte < rules.gte && " +
+      "(rules.lte < this && this < rules.gte)? " +
+      "\'value must be greater than or equal to " +
+      "%s or less than or equal to %s\'.format([" +
+      "rules.gte, rules.lte]) : \'\'H\001R\003gte\022z\n\002in" +
+      "\030\006 \003(\004Bj\302Hg\ne\n\tuint64.in\032X!(this in dyn(" +
+      "rules)[\'in\']) ? \'value must be in list %" +
+      "s\'.format([dyn(rules)[\'in\']]) : \'\'R\002in\022~" +
+      "\n\006not_in\030\007 \003(\004Bg\302Hd\nb\n\ruint64.not_in\032Qth" +
+      "is in rules.not_in ? \'value must not be " +
+      "in list %s\'.format([rules.not_in]) : \'\'R" +
+      "\005notInB\013\n\tless_thanB\016\n\014greater_thanB\010\n\006_" +
+      "const\"\362\024\n\013SInt32Rules\022v\n\005const\030\001 \001(\021B[\302H" +
+      "X\nV\n\014sint32.const\032Fthis != rules.const ?" +
+      " \'value must equal %s\'.format([rules.con" +
+      "st]) : \'\'H\002R\005const\210\001\001\022\217\001\n\002lt\030\002 \001(\021B}\302Hz\n" +
+      "x\n\tsint32.lt\032k!has(rules.gte) && !has(ru" +
+      "les.gt) && this >= rules.lt? \'value must" +
+      " be less than %s\'.format([rules.lt]) : \'" +
+      "\'H\000R\002lt\022\242\001\n\003lte\030\003 \001(\021B\215\001\302H\211\001\n\206\001\n\nsint32." +
+      "lte\032x!has(rules.gte) && !has(rules.gt) &" +
+      "& this > rules.lte? \'value must be less " +
+      "than or equal to %s\'.format([rules.lte])" +
+      " : \'\'H\000R\003lte\022\240\007\n\002gt\030\004 \001(\021B\215\007\302H\211\007\n{\n\tsint" +
+      "32.gt\032n!has(rules.lt) && !has(rules.lte)" +
+      " && this <= rules.gt? \'value must be gre" +
+      "ater than %s\'.format([rules.gt]) : \'\'\n\264\001" +
+      "\n\014sint32.gt_lt\032\243\001has(rules.lt) && rules." +
+      "lt >= rules.gt && (this >= rules.lt || t" +
+      "his <= rules.gt)? \'value must be greater" +
+      " than %s and less than %s\'.format([rules" +
+      ".gt, rules.lt]) : \'\'\n\274\001\n\026sint32.gt_lt_ex" +
+      "clusive\032\241\001has(rules.lt) && rules.lt < ru" +
+      "les.gt && (rules.lt <= this && this <= r" +
+      "ules.gt)? \'value must be greater than %s" +
+      " or less than %s\'.format([rules.gt, rule" +
+      "s.lt]) : \'\'\n\304\001\n\rsint32.gt_lte\032\262\001has(rule" +
+      "s.lte) && rules.lte >= rules.gt && (this" +
+      " > rules.lte || this <= rules.gt)? \'valu" +
+      "e must be greater than %s and less than " +
+      "or equal to %s\'.format([rules.gt, rules." +
+      "lte]) : \'\'\n\314\001\n\027sint32.gt_lte_exclusive\032\260" +
+      "\001has(rules.lte) && rules.lte < rules.gt " +
+      "&& (rules.lte < this && this <= rules.gt" +
+      ")? \'value must be greater than %s or les" +
+      "s than or equal to %s\'.format([rules.gt," +
+      " rules.lte]) : \'\'H\001R\002gt\022\355\007\n\003gte\030\005 \001(\021B\330\007" +
+      "\302H\324\007\n\211\001\n\nsint32.gte\032{!has(rules.lt) && !" +
+      "has(rules.lte) && this < rules.gte? \'val" +
+      "ue must be greater than or equal to %s\'." +
+      "format([rules.gte]) : \'\'\n\303\001\n\rsint32.gte_" +
       "lt\032\261\001has(rules.lt) && rules.lt >= rules." +
       "gte && (this >= rules.lt || this < rules" +
       ".gte)? \'value must be greater than or eq" +
       "ual to %s and less than %s\'.format([rule" +
-      "s.gte, rules.lt]) : \'\'\n\312\001\n\026int64.gte_lt_" +
-      "exclusive\032\257\001has(rules.lt) && rules.lt < " +
-      "rules.gte && (rules.lt <= this && this <" +
-      " rules.gte)? \'value must be greater than" +
-      " or equal to %s or less than %s\'.format(" +
-      "[rules.gte, rules.lt]) : \'\'\n\322\001\n\rint64.gt" +
-      "e_lte\032\300\001has(rules.lte) && rules.lte >= r" +
-      "ules.gte && (this > rules.lte || this < " +
-      "rules.gte)? \'value must be greater than " +
-      "or equal to %s and less than or equal to" +
-      " %s\'.format([rules.gte, rules.lte]) : \'\'" +
-      "\n\332\001\n\027int64.gte_lte_exclusive\032\276\001has(rules" +
+      "s.gte, rules.lt]) : \'\'\n\313\001\n\027sint32.gte_lt" +
+      "_exclusive\032\257\001has(rules.lt) && rules.lt <" +
+      " rules.gte && (rules.lt <= this && this " +
+      "< rules.gte)? \'value must be greater tha" +
+      "n or equal to %s or less than %s\'.format" +
+      "([rules.gte, rules.lt]) : \'\'\n\323\001\n\016sint32." +
+      "gte_lte\032\300\001has(rules.lte) && rules.lte >=" +
+      " rules.gte && (this > rules.lte || this " +
+      "< rules.gte)? \'value must be greater tha" +
+      "n or equal to %s and less than or equal " +
+      "to %s\'.format([rules.gte, rules.lte]) : " +
+      "\'\'\n\333\001\n\030sint32.gte_lte_exclusive\032\276\001has(ru" +
+      "les.lte) && rules.lte < rules.gte && (ru" +
+      "les.lte < this && this < rules.gte)? \'va" +
+      "lue must be greater than or equal to %s " +
+      "or less than or equal to %s\'.format([rul" +
+      "es.gte, rules.lte]) : \'\'H\001R\003gte\022z\n\002in\030\006 " +
+      "\003(\021Bj\302Hg\ne\n\tsint32.in\032X!(this in dyn(rul" +
+      "es)[\'in\']) ? \'value must be in list %s\'." +
+      "format([dyn(rules)[\'in\']]) : \'\'R\002in\022~\n\006n" +
+      "ot_in\030\007 \003(\021Bg\302Hd\nb\n\rsint32.not_in\032Qthis " +
+      "in rules.not_in ? \'value must not be in " +
+      "list %s\'.format([rules.not_in]) : \'\'R\005no" +
+      "tInB\013\n\tless_thanB\016\n\014greater_thanB\010\n\006_con" +
+      "st\"\362\024\n\013SInt64Rules\022v\n\005const\030\001 \001(\022B[\302HX\nV" +
+      "\n\014sint64.const\032Fthis != rules.const ? \'v" +
+      "alue must equal %s\'.format([rules.const]" +
+      ") : \'\'H\002R\005const\210\001\001\022\217\001\n\002lt\030\002 \001(\022B}\302Hz\nx\n\t" +
+      "sint64.lt\032k!has(rules.gte) && !has(rules" +
+      ".gt) && this >= rules.lt? \'value must be" +
+      " less than %s\'.format([rules.lt]) : \'\'H\000" +
+      "R\002lt\022\242\001\n\003lte\030\003 \001(\022B\215\001\302H\211\001\n\206\001\n\nsint64.lte" +
+      "\032x!has(rules.gte) && !has(rules.gt) && t" +
+      "his > rules.lte? \'value must be less tha" +
+      "n or equal to %s\'.format([rules.lte]) : " +
+      "\'\'H\000R\003lte\022\240\007\n\002gt\030\004 \001(\022B\215\007\302H\211\007\n{\n\tsint64." +
+      "gt\032n!has(rules.lt) && !has(rules.lte) &&" +
+      " this <= rules.gt? \'value must be greate" +
+      "r than %s\'.format([rules.gt]) : \'\'\n\264\001\n\014s" +
+      "int64.gt_lt\032\243\001has(rules.lt) && rules.lt " +
+      ">= rules.gt && (this >= rules.lt || this" +
+      " <= rules.gt)? \'value must be greater th" +
+      "an %s and less than %s\'.format([rules.gt" +
+      ", rules.lt]) : \'\'\n\274\001\n\026sint64.gt_lt_exclu" +
+      "sive\032\241\001has(rules.lt) && rules.lt < rules" +
+      ".gt && (rules.lt <= this && this <= rule" +
+      "s.gt)? \'value must be greater than %s or" +
+      " less than %s\'.format([rules.gt, rules.l" +
+      "t]) : \'\'\n\304\001\n\rsint64.gt_lte\032\262\001has(rules.l" +
+      "te) && rules.lte >= rules.gt && (this > " +
+      "rules.lte || this <= rules.gt)? \'value m" +
+      "ust be greater than %s and less than or " +
+      "equal to %s\'.format([rules.gt, rules.lte" +
+      "]) : \'\'\n\314\001\n\027sint64.gt_lte_exclusive\032\260\001ha" +
+      "s(rules.lte) && rules.lte < rules.gt && " +
+      "(rules.lte < this && this <= rules.gt)? " +
+      "\'value must be greater than %s or less t" +
+      "han or equal to %s\'.format([rules.gt, ru" +
+      "les.lte]) : \'\'H\001R\002gt\022\355\007\n\003gte\030\005 \001(\022B\330\007\302H\324" +
+      "\007\n\211\001\n\nsint64.gte\032{!has(rules.lt) && !has" +
+      "(rules.lte) && this < rules.gte? \'value " +
+      "must be greater than or equal to %s\'.for" +
+      "mat([rules.gte]) : \'\'\n\303\001\n\rsint64.gte_lt\032" +
+      "\261\001has(rules.lt) && rules.lt >= rules.gte" +
+      " && (this >= rules.lt || this < rules.gt" +
+      "e)? \'value must be greater than or equal" +
+      " to %s and less than %s\'.format([rules.g" +
+      "te, rules.lt]) : \'\'\n\313\001\n\027sint64.gte_lt_ex" +
+      "clusive\032\257\001has(rules.lt) && rules.lt < ru" +
+      "les.gte && (rules.lt <= this && this < r" +
+      "ules.gte)? \'value must be greater than o" +
+      "r equal to %s or less than %s\'.format([r" +
+      "ules.gte, rules.lt]) : \'\'\n\323\001\n\016sint64.gte" +
+      "_lte\032\300\001has(rules.lte) && rules.lte >= ru" +
+      "les.gte && (this > rules.lte || this < r" +
+      "ules.gte)? \'value must be greater than o" +
+      "r equal to %s and less than or equal to " +
+      "%s\'.format([rules.gte, rules.lte]) : \'\'\n" +
+      "\333\001\n\030sint64.gte_lte_exclusive\032\276\001has(rules" +
       ".lte) && rules.lte < rules.gte && (rules" +
       ".lte < this && this < rules.gte)? \'value" +
       " must be greater than or equal to %s or " +
       "less than or equal to %s\'.format([rules." +
-      "gte, rules.lte]) : \'\'H\001R\003gte\022y\n\002in\030\006 \003(\003" +
-      "Bi\302Hf\nd\n\010int64.in\032X!(this in dyn(rules)[" +
-      "\'in\']) ? \'value must be in list %s\'.form" +
-      "at([dyn(rules)[\'in\']]) : \'\'R\002in\022}\n\006not_i" +
-      "n\030\007 \003(\003Bf\302Hc\na\n\014int64.not_in\032Qthis in ru" +
-      "les.not_in ? \'value must not be in list " +
-      "%s\'.format([rules.not_in]) : \'\'R\005notInB\013" +
-      "\n\tless_thanB\016\n\014greater_thanB\010\n\006_const\"\362\024" +
-      "\n\013UInt32Rules\022v\n\005const\030\001 \001(\rB[\302HX\nV\n\014uin" +
-      "t32.const\032Fthis != rules.const ? \'value " +
-      "must equal %s\'.format([rules.const]) : \'" +
-      "\'H\002R\005const\210\001\001\022\217\001\n\002lt\030\002 \001(\rB}\302Hz\nx\n\tuint3" +
-      "2.lt\032k!has(rules.gte) && !has(rules.gt) " +
-      "&& this >= rules.lt? \'value must be less" +
-      " than %s\'.format([rules.lt]) : \'\'H\000R\002lt\022" +
-      "\242\001\n\003lte\030\003 \001(\rB\215\001\302H\211\001\n\206\001\n\nuint32.lte\032x!ha" +
-      "s(rules.gte) && !has(rules.gt) && this >" +
-      " rules.lte? \'value must be less than or " +
-      "equal to %s\'.format([rules.lte]) : \'\'H\000R" +
-      "\003lte\022\240\007\n\002gt\030\004 \001(\rB\215\007\302H\211\007\n{\n\tuint32.gt\032n!" +
-      "has(rules.lt) && !has(rules.lte) && this" +
-      " <= rules.gt? \'value must be greater tha" +
-      "n %s\'.format([rules.gt]) : \'\'\n\264\001\n\014uint32" +
+      "gte, rules.lte]) : \'\'H\001R\003gte\022z\n\002in\030\006 \003(\022" +
+      "Bj\302Hg\ne\n\tsint64.in\032X!(this in dyn(rules)" +
+      "[\'in\']) ? \'value must be in list %s\'.for" +
+      "mat([dyn(rules)[\'in\']]) : \'\'R\002in\022~\n\006not_" +
+      "in\030\007 \003(\022Bg\302Hd\nb\n\rsint64.not_in\032Qthis in " +
+      "rules.not_in ? \'value must not be in lis" +
+      "t %s\'.format([rules.not_in]) : \'\'R\005notIn" +
+      "B\013\n\tless_thanB\016\n\014greater_thanB\010\n\006_const\"" +
+      "\202\025\n\014Fixed32Rules\022w\n\005const\030\001 \001(\007B\\\302HY\nW\n\r" +
+      "fixed32.const\032Fthis != rules.const ? \'va" +
+      "lue must equal %s\'.format([rules.const])" +
+      " : \'\'H\002R\005const\210\001\001\022\220\001\n\002lt\030\002 \001(\007B~\302H{\ny\n\nf" +
+      "ixed32.lt\032k!has(rules.gte) && !has(rules" +
+      ".gt) && this >= rules.lt? \'value must be" +
+      " less than %s\'.format([rules.lt]) : \'\'H\000" +
+      "R\002lt\022\243\001\n\003lte\030\003 \001(\007B\216\001\302H\212\001\n\207\001\n\013fixed32.lt" +
+      "e\032x!has(rules.gte) && !has(rules.gt) && " +
+      "this > rules.lte? \'value must be less th" +
+      "an or equal to %s\'.format([rules.lte]) :" +
+      " \'\'H\000R\003lte\022\245\007\n\002gt\030\004 \001(\007B\222\007\302H\216\007\n|\n\nfixed3" +
+      "2.gt\032n!has(rules.lt) && !has(rules.lte) " +
+      "&& this <= rules.gt? \'value must be grea" +
+      "ter than %s\'.format([rules.gt]) : \'\'\n\265\001\n" +
+      "\rfixed32.gt_lt\032\243\001has(rules.lt) && rules." +
+      "lt >= rules.gt && (this >= rules.lt || t" +
+      "his <= rules.gt)? \'value must be greater" +
+      " than %s and less than %s\'.format([rules" +
+      ".gt, rules.lt]) : \'\'\n\275\001\n\027fixed32.gt_lt_e" +
+      "xclusive\032\241\001has(rules.lt) && rules.lt < r" +
+      "ules.gt && (rules.lt <= this && this <= " +
+      "rules.gt)? \'value must be greater than %" +
+      "s or less than %s\'.format([rules.gt, rul" +
+      "es.lt]) : \'\'\n\305\001\n\016fixed32.gt_lte\032\262\001has(ru" +
+      "les.lte) && rules.lte >= rules.gt && (th" +
+      "is > rules.lte || this <= rules.gt)? \'va" +
+      "lue must be greater than %s and less tha" +
+      "n or equal to %s\'.format([rules.gt, rule" +
+      "s.lte]) : \'\'\n\315\001\n\030fixed32.gt_lte_exclusiv" +
+      "e\032\260\001has(rules.lte) && rules.lte < rules." +
+      "gt && (rules.lte < this && this <= rules" +
+      ".gt)? \'value must be greater than %s or " +
+      "less than or equal to %s\'.format([rules." +
+      "gt, rules.lte]) : \'\'H\001R\002gt\022\362\007\n\003gte\030\005 \001(\007" +
+      "B\335\007\302H\331\007\n\212\001\n\013fixed32.gte\032{!has(rules.lt) " +
+      "&& !has(rules.lte) && this < rules.gte? " +
+      "\'value must be greater than or equal to " +
+      "%s\'.format([rules.gte]) : \'\'\n\304\001\n\016fixed32" +
+      ".gte_lt\032\261\001has(rules.lt) && rules.lt >= r" +
+      "ules.gte && (this >= rules.lt || this < " +
+      "rules.gte)? \'value must be greater than " +
+      "or equal to %s and less than %s\'.format(" +
+      "[rules.gte, rules.lt]) : \'\'\n\314\001\n\030fixed32." +
+      "gte_lt_exclusive\032\257\001has(rules.lt) && rule" +
+      "s.lt < rules.gte && (rules.lt <= this &&" +
+      " this < rules.gte)? \'value must be great" +
+      "er than or equal to %s or less than %s\'." +
+      "format([rules.gte, rules.lt]) : \'\'\n\324\001\n\017f" +
+      "ixed32.gte_lte\032\300\001has(rules.lte) && rules" +
+      ".lte >= rules.gte && (this > rules.lte |" +
+      "| this < rules.gte)? \'value must be grea" +
+      "ter than or equal to %s and less than or" +
+      " equal to %s\'.format([rules.gte, rules.l" +
+      "te]) : \'\'\n\334\001\n\031fixed32.gte_lte_exclusive\032" +
+      "\276\001has(rules.lte) && rules.lte < rules.gt" +
+      "e && (rules.lte < this && this < rules.g" +
+      "te)? \'value must be greater than or equa" +
+      "l to %s or less than or equal to %s\'.for" +
+      "mat([rules.gte, rules.lte]) : \'\'H\001R\003gte\022" +
+      "{\n\002in\030\006 \003(\007Bk\302Hh\nf\n\nfixed32.in\032X!(this i" +
+      "n dyn(rules)[\'in\']) ? \'value must be in " +
+      "list %s\'.format([dyn(rules)[\'in\']]) : \'\'" +
+      "R\002in\022\177\n\006not_in\030\007 \003(\007Bh\302He\nc\n\016fixed32.not" +
+      "_in\032Qthis in rules.not_in ? \'value must " +
+      "not be in list %s\'.format([rules.not_in]" +
+      ") : \'\'R\005notInB\013\n\tless_thanB\016\n\014greater_th" +
+      "anB\010\n\006_const\"\202\025\n\014Fixed64Rules\022w\n\005const\030\001" +
+      " \001(\006B\\\302HY\nW\n\rfixed64.const\032Fthis != rule" +
+      "s.const ? \'value must equal %s\'.format([" +
+      "rules.const]) : \'\'H\002R\005const\210\001\001\022\220\001\n\002lt\030\002 " +
+      "\001(\006B~\302H{\ny\n\nfixed64.lt\032k!has(rules.gte) " +
+      "&& !has(rules.gt) && this >= rules.lt? \'" +
+      "value must be less than %s\'.format([rule" +
+      "s.lt]) : \'\'H\000R\002lt\022\243\001\n\003lte\030\003 \001(\006B\216\001\302H\212\001\n\207" +
+      "\001\n\013fixed64.lte\032x!has(rules.gte) && !has(" +
+      "rules.gt) && this > rules.lte? \'value mu" +
+      "st be less than or equal to %s\'.format([" +
+      "rules.lte]) : \'\'H\000R\003lte\022\245\007\n\002gt\030\004 \001(\006B\222\007\302" +
+      "H\216\007\n|\n\nfixed64.gt\032n!has(rules.lt) && !ha" +
+      "s(rules.lte) && this <= rules.gt? \'value" +
+      " must be greater than %s\'.format([rules." +
+      "gt]) : \'\'\n\265\001\n\rfixed64.gt_lt\032\243\001has(rules." +
+      "lt) && rules.lt >= rules.gt && (this >= " +
+      "rules.lt || this <= rules.gt)? \'value mu" +
+      "st be greater than %s and less than %s\'." +
+      "format([rules.gt, rules.lt]) : \'\'\n\275\001\n\027fi" +
+      "xed64.gt_lt_exclusive\032\241\001has(rules.lt) &&" +
+      " rules.lt < rules.gt && (rules.lt <= thi" +
+      "s && this <= rules.gt)? \'value must be g" +
+      "reater than %s or less than %s\'.format([" +
+      "rules.gt, rules.lt]) : \'\'\n\305\001\n\016fixed64.gt" +
+      "_lte\032\262\001has(rules.lte) && rules.lte >= ru" +
+      "les.gt && (this > rules.lte || this <= r" +
+      "ules.gt)? \'value must be greater than %s" +
+      " and less than or equal to %s\'.format([r" +
+      "ules.gt, rules.lte]) : \'\'\n\315\001\n\030fixed64.gt" +
+      "_lte_exclusive\032\260\001has(rules.lte) && rules" +
+      ".lte < rules.gt && (rules.lte < this && " +
+      "this <= rules.gt)? \'value must be greate" +
+      "r than %s or less than or equal to %s\'.f" +
+      "ormat([rules.gt, rules.lte]) : \'\'H\001R\002gt\022" +
+      "\362\007\n\003gte\030\005 \001(\006B\335\007\302H\331\007\n\212\001\n\013fixed64.gte\032{!h" +
+      "as(rules.lt) && !has(rules.lte) && this " +
+      "< rules.gte? \'value must be greater than" +
+      " or equal to %s\'.format([rules.gte]) : \'" +
+      "\'\n\304\001\n\016fixed64.gte_lt\032\261\001has(rules.lt) && " +
+      "rules.lt >= rules.gte && (this >= rules." +
+      "lt || this < rules.gte)? \'value must be " +
+      "greater than or equal to %s and less tha" +
+      "n %s\'.format([rules.gte, rules.lt]) : \'\'" +
+      "\n\314\001\n\030fixed64.gte_lt_exclusive\032\257\001has(rule" +
+      "s.lt) && rules.lt < rules.gte && (rules." +
+      "lt <= this && this < rules.gte)? \'value " +
+      "must be greater than or equal to %s or l" +
+      "ess than %s\'.format([rules.gte, rules.lt" +
+      "]) : \'\'\n\324\001\n\017fixed64.gte_lte\032\300\001has(rules." +
+      "lte) && rules.lte >= rules.gte && (this " +
+      "> rules.lte || this < rules.gte)? \'value" +
+      " must be greater than or equal to %s and" +
+      " less than or equal to %s\'.format([rules" +
+      ".gte, rules.lte]) : \'\'\n\334\001\n\031fixed64.gte_l" +
+      "te_exclusive\032\276\001has(rules.lte) && rules.l" +
+      "te < rules.gte && (rules.lte < this && t" +
+      "his < rules.gte)? \'value must be greater" +
+      " than or equal to %s or less than or equ" +
+      "al to %s\'.format([rules.gte, rules.lte])" +
+      " : \'\'H\001R\003gte\022{\n\002in\030\006 \003(\006Bk\302Hh\nf\n\nfixed64" +
+      ".in\032X!(this in dyn(rules)[\'in\']) ? \'valu" +
+      "e must be in list %s\'.format([dyn(rules)" +
+      "[\'in\']]) : \'\'R\002in\022\177\n\006not_in\030\007 \003(\006Bh\302He\nc" +
+      "\n\016fixed64.not_in\032Qthis in rules.not_in ?" +
+      " \'value must not be in list %s\'.format([" +
+      "rules.not_in]) : \'\'R\005notInB\013\n\tless_thanB" +
+      "\016\n\014greater_thanB\010\n\006_const\"\223\025\n\rSFixed32Ru" +
+      "les\022x\n\005const\030\001 \001(\017B]\302HZ\nX\n\016sfixed32.cons" +
+      "t\032Fthis != rules.const ? \'value must equ" +
+      "al %s\'.format([rules.const]) : \'\'H\002R\005con" +
+      "st\210\001\001\022\221\001\n\002lt\030\002 \001(\017B\177\302H|\nz\n\013sfixed32.lt\032k" +
+      "!has(rules.gte) && !has(rules.gt) && thi" +
+      "s >= rules.lt? \'value must be less than " +
+      "%s\'.format([rules.lt]) : \'\'H\000R\002lt\022\244\001\n\003lt" +
+      "e\030\003 \001(\017B\217\001\302H\213\001\n\210\001\n\014sfixed32.lte\032x!has(ru" +
+      "les.gte) && !has(rules.gt) && this > rul" +
+      "es.lte? \'value must be less than or equa" +
+      "l to %s\'.format([rules.lte]) : \'\'H\000R\003lte" +
+      "\022\252\007\n\002gt\030\004 \001(\017B\227\007\302H\223\007\n}\n\013sfixed32.gt\032n!ha" +
+      "s(rules.lt) && !has(rules.lte) && this <" +
+      "= rules.gt? \'value must be greater than " +
+      "%s\'.format([rules.gt]) : \'\'\n\266\001\n\016sfixed32" +
       ".gt_lt\032\243\001has(rules.lt) && rules.lt >= ru" +
       "les.gt && (this >= rules.lt || this <= r" +
       "ules.gt)? \'value must be greater than %s" +
       " and less than %s\'.format([rules.gt, rul" +
-      "es.lt]) : \'\'\n\274\001\n\026uint32.gt_lt_exclusive\032" +
-      "\241\001has(rules.lt) && rules.lt < rules.gt &" +
-      "& (rules.lt <= this && this <= rules.gt)" +
-      "? \'value must be greater than %s or less" +
-      " than %s\'.format([rules.gt, rules.lt]) :" +
-      " \'\'\n\304\001\n\ruint32.gt_lte\032\262\001has(rules.lte) &" +
-      "& rules.lte >= rules.gt && (this > rules" +
-      ".lte || this <= rules.gt)? \'value must b" +
-      "e greater than %s and less than or equal" +
-      " to %s\'.format([rules.gt, rules.lte]) : " +
-      "\'\'\n\314\001\n\027uint32.gt_lte_exclusive\032\260\001has(rul" +
-      "es.lte) && rules.lte < rules.gt && (rule" +
-      "s.lte < this && this <= rules.gt)? \'valu" +
-      "e must be greater than %s or less than o" +
-      "r equal to %s\'.format([rules.gt, rules.l" +
-      "te]) : \'\'H\001R\002gt\022\355\007\n\003gte\030\005 \001(\rB\330\007\302H\324\007\n\211\001\n" +
-      "\nuint32.gte\032{!has(rules.lt) && !has(rule" +
-      "s.lte) && this < rules.gte? \'value must " +
-      "be greater than or equal to %s\'.format([" +
-      "rules.gte]) : \'\'\n\303\001\n\ruint32.gte_lt\032\261\001has" +
+      "es.lt]) : \'\'\n\276\001\n\030sfixed32.gt_lt_exclusiv" +
+      "e\032\241\001has(rules.lt) && rules.lt < rules.gt" +
+      " && (rules.lt <= this && this <= rules.g" +
+      "t)? \'value must be greater than %s or le" +
+      "ss than %s\'.format([rules.gt, rules.lt])" +
+      " : \'\'\n\306\001\n\017sfixed32.gt_lte\032\262\001has(rules.lt" +
+      "e) && rules.lte >= rules.gt && (this > r" +
+      "ules.lte || this <= rules.gt)? \'value mu" +
+      "st be greater than %s and less than or e" +
+      "qual to %s\'.format([rules.gt, rules.lte]" +
+      ") : \'\'\n\316\001\n\031sfixed32.gt_lte_exclusive\032\260\001h" +
+      "as(rules.lte) && rules.lte < rules.gt &&" +
+      " (rules.lte < this && this <= rules.gt)?" +
+      " \'value must be greater than %s or less " +
+      "than or equal to %s\'.format([rules.gt, r" +
+      "ules.lte]) : \'\'H\001R\002gt\022\367\007\n\003gte\030\005 \001(\017B\342\007\302H" +
+      "\336\007\n\213\001\n\014sfixed32.gte\032{!has(rules.lt) && !" +
+      "has(rules.lte) && this < rules.gte? \'val" +
+      "ue must be greater than or equal to %s\'." +
+      "format([rules.gte]) : \'\'\n\305\001\n\017sfixed32.gt" +
+      "e_lt\032\261\001has(rules.lt) && rules.lt >= rule" +
+      "s.gte && (this >= rules.lt || this < rul" +
+      "es.gte)? \'value must be greater than or " +
+      "equal to %s and less than %s\'.format([ru" +
+      "les.gte, rules.lt]) : \'\'\n\315\001\n\031sfixed32.gt" +
+      "e_lt_exclusive\032\257\001has(rules.lt) && rules." +
+      "lt < rules.gte && (rules.lt <= this && t" +
+      "his < rules.gte)? \'value must be greater" +
+      " than or equal to %s or less than %s\'.fo" +
+      "rmat([rules.gte, rules.lt]) : \'\'\n\325\001\n\020sfi" +
+      "xed32.gte_lte\032\300\001has(rules.lte) && rules." +
+      "lte >= rules.gte && (this > rules.lte ||" +
+      " this < rules.gte)? \'value must be great" +
+      "er than or equal to %s and less than or " +
+      "equal to %s\'.format([rules.gte, rules.lt" +
+      "e]) : \'\'\n\335\001\n\032sfixed32.gte_lte_exclusive\032" +
+      "\276\001has(rules.lte) && rules.lte < rules.gt" +
+      "e && (rules.lte < this && this < rules.g" +
+      "te)? \'value must be greater than or equa" +
+      "l to %s or less than or equal to %s\'.for" +
+      "mat([rules.gte, rules.lte]) : \'\'H\001R\003gte\022" +
+      "|\n\002in\030\006 \003(\017Bl\302Hi\ng\n\013sfixed32.in\032X!(this " +
+      "in dyn(rules)[\'in\']) ? \'value must be in" +
+      " list %s\'.format([dyn(rules)[\'in\']]) : \'" +
+      "\'R\002in\022\200\001\n\006not_in\030\007 \003(\017Bi\302Hf\nd\n\017sfixed32." +
+      "not_in\032Qthis in rules.not_in ? \'value mu" +
+      "st not be in list %s\'.format([rules.not_" +
+      "in]) : \'\'R\005notInB\013\n\tless_thanB\016\n\014greater" +
+      "_thanB\010\n\006_const\"\223\025\n\rSFixed64Rules\022x\n\005con" +
+      "st\030\001 \001(\020B]\302HZ\nX\n\016sfixed64.const\032Fthis !=" +
+      " rules.const ? \'value must equal %s\'.for" +
+      "mat([rules.const]) : \'\'H\002R\005const\210\001\001\022\221\001\n\002" +
+      "lt\030\002 \001(\020B\177\302H|\nz\n\013sfixed64.lt\032k!has(rules",
+      ".gte) && !has(rules.gt) && this >= rules" +
+      ".lt? \'value must be less than %s\'.format" +
+      "([rules.lt]) : \'\'H\000R\002lt\022\244\001\n\003lte\030\003 \001(\020B\217\001" +
+      "\302H\213\001\n\210\001\n\014sfixed64.lte\032x!has(rules.gte) &" +
+      "& !has(rules.gt) && this > rules.lte? \'v" +
+      "alue must be less than or equal to %s\'.f" +
+      "ormat([rules.lte]) : \'\'H\000R\003lte\022\252\007\n\002gt\030\004 " +
+      "\001(\020B\227\007\302H\223\007\n}\n\013sfixed64.gt\032n!has(rules.lt" +
+      ") && !has(rules.lte) && this <= rules.gt" +
+      "? \'value must be greater than %s\'.format" +
+      "([rules.gt]) : \'\'\n\266\001\n\016sfixed64.gt_lt\032\243\001h" +
+      "as(rules.lt) && rules.lt >= rules.gt && " +
+      "(this >= rules.lt || this <= rules.gt)? " +
+      "\'value must be greater than %s and less " +
+      "than %s\'.format([rules.gt, rules.lt]) : " +
+      "\'\'\n\276\001\n\030sfixed64.gt_lt_exclusive\032\241\001has(ru" +
+      "les.lt) && rules.lt < rules.gt && (rules" +
+      ".lt <= this && this <= rules.gt)? \'value" +
+      " must be greater than %s or less than %s" +
+      "\'.format([rules.gt, rules.lt]) : \'\'\n\306\001\n\017" +
+      "sfixed64.gt_lte\032\262\001has(rules.lte) && rule" +
+      "s.lte >= rules.gt && (this > rules.lte |" +
+      "| this <= rules.gt)? \'value must be grea" +
+      "ter than %s and less than or equal to %s" +
+      "\'.format([rules.gt, rules.lte]) : \'\'\n\316\001\n" +
+      "\031sfixed64.gt_lte_exclusive\032\260\001has(rules.l" +
+      "te) && rules.lte < rules.gt && (rules.lt" +
+      "e < this && this <= rules.gt)? \'value mu" +
+      "st be greater than %s or less than or eq" +
+      "ual to %s\'.format([rules.gt, rules.lte])" +
+      " : \'\'H\001R\002gt\022\367\007\n\003gte\030\005 \001(\020B\342\007\302H\336\007\n\213\001\n\014sfi" +
+      "xed64.gte\032{!has(rules.lt) && !has(rules." +
+      "lte) && this < rules.gte? \'value must be" +
+      " greater than or equal to %s\'.format([ru" +
+      "les.gte]) : \'\'\n\305\001\n\017sfixed64.gte_lt\032\261\001has" +
       "(rules.lt) && rules.lt >= rules.gte && (" +
       "this >= rules.lt || this < rules.gte)? \'" +
       "value must be greater than or equal to %" +
       "s and less than %s\'.format([rules.gte, r" +
-      "ules.lt]) : \'\'\n\313\001\n\027uint32.gte_lt_exclusi" +
-      "ve\032\257\001has(rules.lt) && rules.lt < rules.g" +
-      "te && (rules.lt <= this && this < rules." +
-      "gte)? \'value must be greater than or equ" +
-      "al to %s or less than %s\'.format([rules." +
-      "gte, rules.lt]) : \'\'\n\323\001\n\016uint32.gte_lte\032" +
-      "\300\001has(rules.lte) && rules.lte >= rules.g" +
-      "te && (this > rules.lte || this < rules." +
-      "gte)? \'value must be greater than or equ" +
-      "al to %s and less than or equal to %s\'.f" +
-      "ormat([rules.gte, rules.lte]) : \'\'\n\333\001\n\030u" +
-      "int32.gte_lte_exclusive\032\276\001has(rules.lte)" +
-      " && rules.lte < rules.gte && (rules.lte " +
-      "< this && this < rules.gte)? \'value must" +
-      " be greater than or equal to %s or less " +
-      "than or equal to %s\'.format([rules.gte, " +
-      "rules.lte]) : \'\'H\001R\003gte\022z\n\002in\030\006 \003(\rBj\302Hg" +
-      "\ne\n\tuint32.in\032X!(this in dyn(rules)[\'in\'" +
-      "]) ? \'value must be in list %s\'.format([" +
-      "dyn(rules)[\'in\']]) : \'\'R\002in\022~\n\006not_in\030\007 " +
-      "\003(\rBg\302Hd\nb\n\ruint32.not_in\032Qthis in rules" +
-      ".not_in ? \'value must not be in list %s\'" +
-      ".format([rules.not_in]) : \'\'R\005notInB\013\n\tl" +
-      "ess_thanB\016\n\014greater_thanB\010\n\006_const\"\362\024\n\013U" +
-      "Int64Rules\022v\n\005const\030\001 \001(\004B[\302HX\nV\n\014uint64" +
-      ".const\032Fthis != rules.const ? \'value mus" +
-      "t equal %s\'.format([rules.const]) : \'\'H\002" +
-      "R\005const\210\001\001\022\217\001\n\002lt\030\002 \001(\004B}\302Hz\nx\n\tuint64.l" +
-      "t\032k!has(rules.gte) && !has(rules.gt) && " +
-      "this >= rules.lt? \'value must be less th" +
-      "an %s\'.format([rules.lt]) : \'\'H\000R\002lt\022\242\001\n" +
-      "\003lte\030\003 \001(\004B\215\001\302H\211\001\n\206\001\n\nuint64.lte\032x!has(r" +
-      "ules.gte) && !has(rules.gt) && this > ru",
-      "les.lte? \'value must be less than or equ" +
-      "al to %s\'.format([rules.lte]) : \'\'H\000R\003lt" +
-      "e\022\240\007\n\002gt\030\004 \001(\004B\215\007\302H\211\007\n{\n\tuint64.gt\032n!has" +
-      "(rules.lt) && !has(rules.lte) && this <=" +
-      " rules.gt? \'value must be greater than %" +
-      "s\'.format([rules.gt]) : \'\'\n\264\001\n\014uint64.gt" +
-      "_lt\032\243\001has(rules.lt) && rules.lt >= rules" +
-      ".gt && (this >= rules.lt || this <= rule" +
-      "s.gt)? \'value must be greater than %s an" +
-      "d less than %s\'.format([rules.gt, rules." +
-      "lt]) : \'\'\n\274\001\n\026uint64.gt_lt_exclusive\032\241\001h" +
-      "as(rules.lt) && rules.lt < rules.gt && (" +
-      "rules.lt <= this && this <= rules.gt)? \'" +
-      "value must be greater than %s or less th" +
-      "an %s\'.format([rules.gt, rules.lt]) : \'\'" +
-      "\n\304\001\n\ruint64.gt_lte\032\262\001has(rules.lte) && r" +
-      "ules.lte >= rules.gt && (this > rules.lt" +
-      "e || this <= rules.gt)? \'value must be g" +
-      "reater than %s and less than or equal to" +
-      " %s\'.format([rules.gt, rules.lte]) : \'\'\n" +
-      "\314\001\n\027uint64.gt_lte_exclusive\032\260\001has(rules." +
-      "lte) && rules.lte < rules.gt && (rules.l" +
-      "te < this && this <= rules.gt)? \'value m" +
-      "ust be greater than %s or less than or e" +
-      "qual to %s\'.format([rules.gt, rules.lte]" +
-      ") : \'\'H\001R\002gt\022\355\007\n\003gte\030\005 \001(\004B\330\007\302H\324\007\n\211\001\n\nui" +
-      "nt64.gte\032{!has(rules.lt) && !has(rules.l" +
-      "te) && this < rules.gte? \'value must be " +
-      "greater than or equal to %s\'.format([rul" +
-      "es.gte]) : \'\'\n\303\001\n\ruint64.gte_lt\032\261\001has(ru" +
-      "les.lt) && rules.lt >= rules.gte && (thi" +
-      "s >= rules.lt || this < rules.gte)? \'val" +
-      "ue must be greater than or equal to %s a" +
-      "nd less than %s\'.format([rules.gte, rule" +
-      "s.lt]) : \'\'\n\313\001\n\027uint64.gte_lt_exclusive\032" +
-      "\257\001has(rules.lt) && rules.lt < rules.gte " +
-      "&& (rules.lt <= this && this < rules.gte" +
-      ")? \'value must be greater than or equal " +
-      "to %s or less than %s\'.format([rules.gte" +
-      ", rules.lt]) : \'\'\n\323\001\n\016uint64.gte_lte\032\300\001h" +
-      "as(rules.lte) && rules.lte >= rules.gte " +
-      "&& (this > rules.lte || this < rules.gte" +
-      ")? \'value must be greater than or equal " +
-      "to %s and less than or equal to %s\'.form" +
-      "at([rules.gte, rules.lte]) : \'\'\n\333\001\n\030uint" +
-      "64.gte_lte_exclusive\032\276\001has(rules.lte) &&" +
-      " rules.lte < rules.gte && (rules.lte < t" +
-      "his && this < rules.gte)? \'value must be" +
-      " greater than or equal to %s or less tha" +
-      "n or equal to %s\'.format([rules.gte, rul" +
-      "es.lte]) : \'\'H\001R\003gte\022z\n\002in\030\006 \003(\004Bj\302Hg\ne\n" +
-      "\tuint64.in\032X!(this in dyn(rules)[\'in\']) " +
-      "? \'value must be in list %s\'.format([dyn" +
-      "(rules)[\'in\']]) : \'\'R\002in\022~\n\006not_in\030\007 \003(\004" +
-      "Bg\302Hd\nb\n\ruint64.not_in\032Qthis in rules.no" +
-      "t_in ? \'value must not be in list %s\'.fo" +
-      "rmat([rules.not_in]) : \'\'R\005notInB\013\n\tless" +
-      "_thanB\016\n\014greater_thanB\010\n\006_const\"\362\024\n\013SInt" +
-      "32Rules\022v\n\005const\030\001 \001(\021B[\302HX\nV\n\014sint32.co" +
+      "ules.lt]) : \'\'\n\315\001\n\031sfixed64.gte_lt_exclu" +
+      "sive\032\257\001has(rules.lt) && rules.lt < rules" +
+      ".gte && (rules.lt <= this && this < rule" +
+      "s.gte)? \'value must be greater than or e" +
+      "qual to %s or less than %s\'.format([rule" +
+      "s.gte, rules.lt]) : \'\'\n\325\001\n\020sfixed64.gte_" +
+      "lte\032\300\001has(rules.lte) && rules.lte >= rul" +
+      "es.gte && (this > rules.lte || this < ru" +
+      "les.gte)? \'value must be greater than or" +
+      " equal to %s and less than or equal to %" +
+      "s\'.format([rules.gte, rules.lte]) : \'\'\n\335" +
+      "\001\n\032sfixed64.gte_lte_exclusive\032\276\001has(rule" +
+      "s.lte) && rules.lte < rules.gte && (rule" +
+      "s.lte < this && this < rules.gte)? \'valu" +
+      "e must be greater than or equal to %s or" +
+      " less than or equal to %s\'.format([rules" +
+      ".gte, rules.lte]) : \'\'H\001R\003gte\022|\n\002in\030\006 \003(" +
+      "\020Bl\302Hi\ng\n\013sfixed64.in\032X!(this in dyn(rul" +
+      "es)[\'in\']) ? \'value must be in list %s\'." +
+      "format([dyn(rules)[\'in\']]) : \'\'R\002in\022\200\001\n\006" +
+      "not_in\030\007 \003(\020Bi\302Hf\nd\n\017sfixed64.not_in\032Qth" +
+      "is in rules.not_in ? \'value must not be " +
+      "in list %s\'.format([rules.not_in]) : \'\'R" +
+      "\005notInB\013\n\tless_thanB\016\n\014greater_thanB\010\n\006_" +
+      "const\"\213\001\n\tBoolRules\022t\n\005const\030\001 \001(\010BY\302HV\n" +
+      "T\n\nbool.const\032Fthis != rules.const ? \'va" +
+      "lue must equal %s\'.format([rules.const])" +
+      " : \'\'H\000R\005const\210\001\001B\010\n\006_const\"\3243\n\013StringRu" +
+      "les\022x\n\005const\030\001 \001(\tB]\302HZ\nX\n\014string.const\032" +
+      "Hthis != rules.const ? \'value must equal" +
+      " `%s`\'.format([rules.const]) : \'\'H\001R\005con" +
+      "st\210\001\001\022\210\001\n\003len\030\023 \001(\004Bq\302Hn\nl\n\nstring.len\032^" +
+      "uint(this.size()) != rules.len ? \'value " +
+      "length must be %s characters\'.format([ru" +
+      "les.len]) : \'\'H\002R\003len\210\001\001\022\246\001\n\007min_len\030\002 \001" +
+      "(\004B\207\001\302H\203\001\n\200\001\n\016string.min_len\032nuint(this." +
+      "size()) < rules.min_len ? \'value length " +
+      "must be at least %s characters\'.format([" +
+      "rules.min_len]) : \'\'H\003R\006minLen\210\001\001\022\244\001\n\007ma" +
+      "x_len\030\003 \001(\004B\205\001\302H\201\001\n\177\n\016string.max_len\032mui" +
+      "nt(this.size()) > rules.max_len ? \'value" +
+      " length must be at most %s characters\'.f" +
+      "ormat([rules.max_len]) : \'\'H\004R\006maxLen\210\001\001" +
+      "\022\252\001\n\tlen_bytes\030\024 \001(\004B\207\001\302H\203\001\n\200\001\n\020string.l" +
+      "en_bytes\032luint(bytes(this).size()) != ru" +
+      "les.len_bytes ? \'value length must be %s" +
+      " bytes\'.format([rules.len_bytes]) : \'\'H\005" +
+      "R\010lenBytes\210\001\001\022\262\001\n\tmin_bytes\030\004 \001(\004B\217\001\302H\213\001" +
+      "\n\210\001\n\020string.min_bytes\032tuint(bytes(this)." +
+      "size()) < rules.min_bytes ? \'value lengt" +
+      "h must be at least %s bytes\'.format([rul" +
+      "es.min_bytes]) : \'\'H\006R\010minBytes\210\001\001\022\261\001\n\tm" +
+      "ax_bytes\030\005 \001(\004B\216\001\302H\212\001\n\207\001\n\020string.max_byt" +
+      "es\032suint(bytes(this).size()) > rules.max" +
+      "_bytes ? \'value length must be at most %" +
+      "s bytes\'.format([rules.max_bytes]) : \'\'H" +
+      "\007R\010maxBytes\210\001\001\022\233\001\n\007pattern\030\006 \001(\tB|\302Hy\nw\n" +
+      "\016string.pattern\032e!this.matches(rules.pat" +
+      "tern) ? \'value does not match regex patt" +
+      "ern `%s`\'.format([rules.pattern]) : \'\'H\010" +
+      "R\007pattern\210\001\001\022\221\001\n\006prefix\030\007 \001(\tBt\302Hq\no\n\rst" +
+      "ring.prefix\032^!this.startsWith(rules.pref" +
+      "ix) ? \'value does not have prefix `%s`\'." +
+      "format([rules.prefix]) : \'\'H\tR\006prefix\210\001\001" +
+      "\022\217\001\n\006suffix\030\010 \001(\tBr\302Ho\nm\n\rstring.suffix\032" +
+      "\\!this.endsWith(rules.suffix) ? \'value d" +
+      "oes not have suffix `%s`\'.format([rules." +
+      "suffix]) : \'\'H\nR\006suffix\210\001\001\022\237\001\n\010contains\030" +
+      "\t \001(\tB~\302H{\ny\n\017string.contains\032f!this.con" +
+      "tains(rules.contains) ? \'value does not " +
+      "contain substring `%s`\'.format([rules.co" +
+      "ntains]) : \'\'H\013R\010contains\210\001\001\022\252\001\n\014not_con" +
+      "tains\030\027 \001(\tB\201\001\302H~\n|\n\023string.not_contains" +
+      "\032ethis.contains(rules.not_contains) ? \'v" +
+      "alue contains substring `%s`\'.format([ru" +
+      "les.not_contains]) : \'\'H\014R\013notContains\210\001" +
+      "\001\022z\n\002in\030\n \003(\tBj\302Hg\ne\n\tstring.in\032X!(this " +
+      "in dyn(rules)[\'in\']) ? \'value must be in" +
+      " list %s\'.format([dyn(rules)[\'in\']]) : \'" +
+      "\'R\002in\022~\n\006not_in\030\013 \003(\tBg\302Hd\nb\n\rstring.not" +
+      "_in\032Qthis in rules.not_in ? \'value must " +
+      "not be in list %s\'.format([rules.not_in]" +
+      ") : \'\'R\005notIn\022\306\001\n\005email\030\014 \001(\010B\255\001\302H\251\001\nQ\n\014" +
+      "string.email\022#value must be a valid emai" +
+      "l address\032\034this == \'\' || this.isEmail()\n" +
+      "T\n\022string.email_empty\0222value is empty, w" +
+      "hich is not a valid email address\032\nthis " +
+      "!= \'\'H\000R\005email\022\313\001\n\010hostname\030\r \001(\010B\254\001\302H\250\001" +
+      "\nR\n\017string.hostname\022\036value must be a val" +
+      "id hostname\032\037this == \'\' || this.isHostna" +
+      "me()\nR\n\025string.hostname_empty\022-value is " +
+      "empty, which is not a valid hostname\032\nth" +
+      "is != \'\'H\000R\010hostname\022\261\001\n\002ip\030\016 \001(\010B\236\001\302H\232\001" +
+      "\nH\n\tstring.ip\022 value must be a valid IP " +
+      "address\032\031this == \'\' || this.isIp()\nN\n\017st" +
+      "ring.ip_empty\022/value is empty, which is " +
+      "not a valid IP address\032\nthis != \'\'H\000R\002ip" +
+      "\022\276\001\n\004ipv4\030\017 \001(\010B\247\001\302H\243\001\nM\n\013string.ipv4\022\"v" +
+      "alue must be a valid IPv4 address\032\032this " +
+      "== \'\' || this.isIp(4)\nR\n\021string.ipv4_emp" +
+      "ty\0221value is empty, which is not a valid" +
+      " IPv4 address\032\nthis != \'\'H\000R\004ipv4\022\276\001\n\004ip" +
+      "v6\030\020 \001(\010B\247\001\302H\243\001\nM\n\013string.ipv6\022\"value mu" +
+      "st be a valid IPv6 address\032\032this == \'\' |" +
+      "| this.isIp(6)\nR\n\021string.ipv6_empty\0221val" +
+      "ue is empty, which is not a valid IPv6 a" +
+      "ddress\032\nthis != \'\'H\000R\004ipv6\022\250\001\n\003uri\030\021 \001(\010" +
+      "B\223\001\302H\217\001\nC\n\nstring.uri\022\031value must be a v" +
+      "alid URI\032\032this == \'\' || this.isUri()\nH\n\020" +
+      "string.uri_empty\022(value is empty, which " +
+      "is not a valid URI\032\nthis != \'\'H\000R\003uri\022\\\n" +
+      "\007uri_ref\030\022 \001(\010BA\302H>\n<\n\016string.uri_ref\022\031v" +
+      "alue must be a valid URI\032\017this.isUriRef(" +
+      ")H\000R\006uriRef\022\364\001\n\007address\030\025 \001(\010B\327\001\302H\323\001\no\n\016" +
+      "string.address\022-value must be a valid ho" +
+      "stname, or ip address\032.this == \'\' || thi" +
+      "s.isHostname() || this.isIp()\n`\n\024string." +
+      "address_empty\022 rules.max_len ? \'value must be a" +
+      "t most %s bytes\'.format([rules.max_len])" +
+      " : \'\'H\004R\006maxLen\210\001\001\022\236\001\n\007pattern\030\004 \001(\tB\177\302H" +
+      "|\nz\n\rbytes.pattern\032i!string(this).matche" +
+      "s(rules.pattern) ? \'value must match reg" +
+      "ex pattern `%s`\'.format([rules.pattern])" +
+      " : \'\'H\005R\007pattern\210\001\001\022\216\001\n\006prefix\030\005 \001(\014Bq\302H" +
+      "n\nl\n\014bytes.prefix\032\\!this.startsWith(rule" +
+      "s.prefix) ? \'value does not have prefix " +
+      "%x\'.format([rules.prefix]) : \'\'H\006R\006prefi" +
+      "x\210\001\001\022\214\001\n\006suffix\030\006 \001(\014Bo\302Hl\nj\n\014bytes.suff" +
+      "ix\032Z!this.endsWith(rules.suffix) ? \'valu" +
+      "e does not have suffix %x\'.format([rules" +
+      ".suffix]) : \'\'H\007R\006suffix\210\001\001\022\222\001\n\010contains" +
+      "\030\007 \001(\014Bq\302Hn\nl\n\016bytes.contains\032Z!this.con" +
+      "tains(rules.contains) ? \'value does not " +
+      "contain %x\'.format([rules.contains]) : \'" +
+      "\'H\010R\010contains\210\001\001\022\233\001\n\002in\030\010 \003(\014B\212\001\302H\206\001\n\203\001\n" +
+      "\010bytes.in\032wdyn(rules)[\'in\'].size() > 0 &" +
+      "& !(this in dyn(rules)[\'in\']) ? \'value m" +
+      "ust be in list %s\'.format([dyn(rules)[\'i" +
+      "n\']]) : \'\'R\002in\022}\n\006not_in\030\t \003(\014Bf\302Hc\na\n\014b" +
+      "ytes.not_in\032Qthis in rules.not_in ? \'val" +
+      "ue must not be in list %s\'.format([rules" +
+      ".not_in]) : \'\'R\005notIn\022\325\001\n\002ip\030\n \001(\010B\302\001\302H\276" +
+      "\001\ng\n\010bytes.ip\022 value must be a valid IP " +
+      "address\0329this.size() == 0 || this.size()" +
+      " == 4 || this.size() == 16\nS\n\016bytes.ip_e" +
+      "mpty\022/value is empty, which is not a val" +
+      "id IP address\032\020this.size() != 0H\000R\002ip\022\314\001" +
+      "\n\004ipv4\030\013 \001(\010B\265\001\302H\261\001\nV\n\nbytes.ipv4\022\"value" +
+      " must be a valid IPv4 address\032$this.size" +
+      "() == 0 || this.size() == 4\nW\n\020bytes.ipv" +
+      "4_empty\0221value is empty, which is not a " +
+      "valid IPv4 address\032\020this.size() != 0H\000R\004" +
+      "ipv4\022\315\001\n\004ipv6\030\014 \001(\010B\266\001\302H\262\001\nW\n\nbytes.ipv6" +
+      "\022\"value must be a valid IPv6 address\032%th" +
+      "is.size() == 0 || this.size() == 16\nW\n\020b" +
+      "ytes.ipv6_empty\0221value is empty, which i" +
+      "s not a valid IPv6 address\032\020this.size() " +
+      "!= 0H\000R\004ipv6B\014\n\nwell_knownB\010\n\006_constB\006\n\004" +
+      "_lenB\n\n\010_min_lenB\n\n\010_max_lenB\n\n\010_pattern" +
+      "B\t\n\007_prefixB\t\n\007_suffixB\013\n\t_contains\"\274\003\n\t" +
+      "EnumRules\022t\n\005const\030\001 \001(\005BY\302HV\nT\n\nenum.co" +
       "nst\032Fthis != rules.const ? \'value must e" +
-      "qual %s\'.format([rules.const]) : \'\'H\002R\005c" +
-      "onst\210\001\001\022\217\001\n\002lt\030\002 \001(\021B}\302Hz\nx\n\tsint32.lt\032k" +
-      "!has(rules.gte) && !has(rules.gt) && thi" +
-      "s >= rules.lt? \'value must be less than " +
-      "%s\'.format([rules.lt]) : \'\'H\000R\002lt\022\242\001\n\003lt" +
-      "e\030\003 \001(\021B\215\001\302H\211\001\n\206\001\n\nsint32.lte\032x!has(rule" +
-      "s.gte) && !has(rules.gt) && this > rules" +
-      ".lte? \'value must be less than or equal " +
-      "to %s\'.format([rules.lte]) : \'\'H\000R\003lte\022\240" +
-      "\007\n\002gt\030\004 \001(\021B\215\007\302H\211\007\n{\n\tsint32.gt\032n!has(ru" +
-      "les.lt) && !has(rules.lte) && this <= ru" +
-      "les.gt? \'value must be greater than %s\'." +
-      "format([rules.gt]) : \'\'\n\264\001\n\014sint32.gt_lt" +
-      "\032\243\001has(rules.lt) && rules.lt >= rules.gt" +
-      " && (this >= rules.lt || this <= rules.g" +
-      "t)? \'value must be greater than %s and l" +
-      "ess than %s\'.format([rules.gt, rules.lt]" +
-      ") : \'\'\n\274\001\n\026sint32.gt_lt_exclusive\032\241\001has(" +
-      "rules.lt) && rules.lt < rules.gt && (rul" +
-      "es.lt <= this && this <= rules.gt)? \'val" +
-      "ue must be greater than %s or less than " +
-      "%s\'.format([rules.gt, rules.lt]) : \'\'\n\304\001" +
-      "\n\rsint32.gt_lte\032\262\001has(rules.lte) && rule" +
-      "s.lte >= rules.gt && (this > rules.lte |" +
-      "| this <= rules.gt)? \'value must be grea" +
-      "ter than %s and less than or equal to %s" +
-      "\'.format([rules.gt, rules.lte]) : \'\'\n\314\001\n" +
-      "\027sint32.gt_lte_exclusive\032\260\001has(rules.lte" +
-      ") && rules.lte < rules.gt && (rules.lte " +
-      "< this && this <= rules.gt)? \'value must" +
-      " be greater than %s or less than or equa" +
-      "l to %s\'.format([rules.gt, rules.lte]) :" +
-      " \'\'H\001R\002gt\022\355\007\n\003gte\030\005 \001(\021B\330\007\302H\324\007\n\211\001\n\nsint3" +
-      "2.gte\032{!has(rules.lt) && !has(rules.lte)" +
-      " && this < rules.gte? \'value must be gre" +
-      "ater than or equal to %s\'.format([rules." +
-      "gte]) : \'\'\n\303\001\n\rsint32.gte_lt\032\261\001has(rules" +
-      ".lt) && rules.lt >= rules.gte && (this >" +
-      "= rules.lt || this < rules.gte)? \'value " +
-      "must be greater than or equal to %s and " +
-      "less than %s\'.format([rules.gte, rules.l" +
-      "t]) : \'\'\n\313\001\n\027sint32.gte_lt_exclusive\032\257\001h" +
-      "as(rules.lt) && rules.lt < rules.gte && " +
-      "(rules.lt <= this && this < rules.gte)? " +
-      "\'value must be greater than or equal to " +
-      "%s or less than %s\'.format([rules.gte, r" +
-      "ules.lt]) : \'\'\n\323\001\n\016sint32.gte_lte\032\300\001has(" +
-      "rules.lte) && rules.lte >= rules.gte && " +
-      "(this > rules.lte || this < rules.gte)? " +
-      "\'value must be greater than or equal to " +
-      "%s and less than or equal to %s\'.format(" +
-      "[rules.gte, rules.lte]) : \'\'\n\333\001\n\030sint32." +
-      "gte_lte_exclusive\032\276\001has(rules.lte) && ru" +
-      "les.lte < rules.gte && (rules.lte < this" +
-      " && this < rules.gte)? \'value must be gr" +
-      "eater than or equal to %s or less than o" +
-      "r equal to %s\'.format([rules.gte, rules." +
-      "lte]) : \'\'H\001R\003gte\022z\n\002in\030\006 \003(\021Bj\302Hg\ne\n\tsi" +
-      "nt32.in\032X!(this in dyn(rules)[\'in\']) ? \'" +
-      "value must be in list %s\'.format([dyn(ru" +
-      "les)[\'in\']]) : \'\'R\002in\022~\n\006not_in\030\007 \003(\021Bg\302" +
-      "Hd\nb\n\rsint32.not_in\032Qthis in rules.not_i" +
-      "n ? \'value must not be in list %s\'.forma" +
-      "t([rules.not_in]) : \'\'R\005notInB\013\n\tless_th" +
-      "anB\016\n\014greater_thanB\010\n\006_const\"\362\024\n\013SInt64R" +
-      "ules\022v\n\005const\030\001 \001(\022B[\302HX\nV\n\014sint64.const" +
-      "\032Fthis != rules.const ? \'value must equa" +
-      "l %s\'.format([rules.const]) : \'\'H\002R\005cons" +
-      "t\210\001\001\022\217\001\n\002lt\030\002 \001(\022B}\302Hz\nx\n\tsint64.lt\032k!ha" +
-      "s(rules.gte) && !has(rules.gt) && this >" +
-      "= rules.lt? \'value must be less than %s\'" +
-      ".format([rules.lt]) : \'\'H\000R\002lt\022\242\001\n\003lte\030\003" +
-      " \001(\022B\215\001\302H\211\001\n\206\001\n\nsint64.lte\032x!has(rules.g" +
-      "te) && !has(rules.gt) && this > rules.lt" +
-      "e? \'value must be less than or equal to " +
-      "%s\'.format([rules.lte]) : \'\'H\000R\003lte\022\240\007\n\002" +
-      "gt\030\004 \001(\022B\215\007\302H\211\007\n{\n\tsint64.gt\032n!has(rules" +
-      ".lt) && !has(rules.lte) && this <= rules" +
-      ".gt? \'value must be greater than %s\'.for" +
-      "mat([rules.gt]) : \'\'\n\264\001\n\014sint64.gt_lt\032\243\001" +
-      "has(rules.lt) && rules.lt >= rules.gt &&" +
-      " (this >= rules.lt || this <= rules.gt)?" +
-      " \'value must be greater than %s and less" +
-      " than %s\'.format([rules.gt, rules.lt]) :" +
-      " \'\'\n\274\001\n\026sint64.gt_lt_exclusive\032\241\001has(rul" +
+      "qual %s\'.format([rules.const]) : \'\'H\000R\005c" +
+      "onst\210\001\001\022&\n\014defined_only\030\002 \001(\010H\001R\013defined" +
+      "Only\210\001\001\022x\n\002in\030\003 \003(\005Bh\302He\nc\n\007enum.in\032X!(t" +
+      "his in dyn(rules)[\'in\']) ? \'value must b" +
+      "e in list %s\'.format([dyn(rules)[\'in\']])" +
+      " : \'\'R\002in\022|\n\006not_in\030\004 \003(\005Be\302Hb\n`\n\013enum.n" +
+      "ot_in\032Qthis in rules.not_in ? \'value mus" +
+      "t not be in list %s\'.format([rules.not_i" +
+      "n]) : \'\'R\005notInB\010\n\006_constB\017\n\r_defined_on" +
+      "ly\"\315\004\n\rRepeatedRules\022\255\001\n\tmin_items\030\001 \001(\004" +
+      "B\212\001\302H\206\001\n\203\001\n\022repeated.min_items\032muint(thi" +
+      "s.size()) < rules.min_items ? \'value mus" +
+      "t contain at least %d item(s)\'.format([r" +
+      "ules.min_items]) : \'\'H\000R\010minItems\210\001\001\022\261\001\n" +
+      "\tmax_items\030\002 \001(\004B\216\001\302H\212\001\n\207\001\n\022repeated.max" +
+      "_items\032quint(this.size()) > rules.max_it" +
+      "ems ? \'value must contain no more than %" +
+      "s item(s)\'.format([rules.max_items]) : \'" +
+      "\'H\001R\010maxItems\210\001\001\022l\n\006unique\030\003 \001(\010BO\302HL\nJ\n" +
+      "\017repeated.unique\022(repeated value must co" +
+      "ntain unique items\032\rthis.unique()H\002R\006uni" +
+      "que\210\001\001\0229\n\005items\030\004 \001(\0132\036.buf.validate.Fie" +
+      "ldConstraintsH\003R\005items\210\001\001B\014\n\n_min_itemsB" +
+      "\014\n\n_max_itemsB\t\n\007_uniqueB\010\n\006_items\"\361\003\n\010M" +
+      "apRules\022\236\001\n\tmin_pairs\030\001 \001(\004B|\302Hy\nw\n\rmap." +
+      "min_pairs\032fuint(this.size()) < rules.min" +
+      "_pairs ? \'map must be at least %d entrie" +
+      "s\'.format([rules.min_pairs]) : \'\'H\000R\010min" +
+      "Pairs\210\001\001\022\235\001\n\tmax_pairs\030\002 \001(\004B{\302Hx\nv\n\rmap" +
+      ".max_pairs\032euint(this.size()) > rules.ma" +
+      "x_pairs ? \'map must be at most %d entrie" +
+      "s\'.format([rules.max_pairs]) : \'\'H\001R\010max" +
+      "Pairs\210\001\001\0227\n\004keys\030\004 \001(\0132\036.buf.validate.Fi" +
+      "eldConstraintsH\002R\004keys\210\001\001\022;\n\006values\030\005 \001(" +
+      "\0132\036.buf.validate.FieldConstraintsH\003R\006val" +
+      "ues\210\001\001B\014\n\n_min_pairsB\014\n\n_max_pairsB\007\n\005_k" +
+      "eysB\t\n\007_values\"1\n\010AnyRules\022\016\n\002in\030\002 \003(\tR\002" +
+      "in\022\025\n\006not_in\030\003 \003(\tR\005notIn\"\322\026\n\rDurationRu" +
+      "les\022\223\001\n\005const\030\002 \001(\0132\031.google.protobuf.Du" +
+      "rationB]\302HZ\nX\n\016duration.const\032Fthis != r" +
+      "ules.const ? \'value must equal %s\'.forma" +
+      "t([rules.const]) : \'\'H\002R\005const\210\001\001\022\254\001\n\002lt" +
+      "\030\003 \001(\0132\031.google.protobuf.DurationB\177\302H|\nz" +
+      "\n\013duration.lt\032k!has(rules.gte) && !has(r" +
+      "ules.gt) && this >= rules.lt? \'value mus" +
+      "t be less than %s\'.format([rules.lt]) : " +
+      "\'\'H\000R\002lt\022\277\001\n\003lte\030\004 \001(\0132\031.google.protobuf" +
+      ".DurationB\217\001\302H\213\001\n\210\001\n\014duration.lte\032x!has(" +
+      "rules.gte) && !has(rules.gt) && this > r" +
+      "ules.lte? \'value must be less than or eq" +
+      "ual to %s\'.format([rules.lte]) : \'\'H\000R\003l" +
+      "te\022\305\007\n\002gt\030\005 \001(\0132\031.google.protobuf.Durati" +
+      "onB\227\007\302H\223\007\n}\n\013duration.gt\032n!has(rules.lt)" +
+      " && !has(rules.lte) && this <= rules.gt?" +
+      " \'value must be greater than %s\'.format(" +
+      "[rules.gt]) : \'\'\n\266\001\n\016duration.gt_lt\032\243\001ha" +
+      "s(rules.lt) && rules.lt >= rules.gt && (" +
+      "this >= rules.lt || this <= rules.gt)? \'" +
+      "value must be greater than %s and less t" +
+      "han %s\'.format([rules.gt, rules.lt]) : \'" +
+      "\'\n\276\001\n\030duration.gt_lt_exclusive\032\241\001has(rul" +
       "es.lt) && rules.lt < rules.gt && (rules." +
       "lt <= this && this <= rules.gt)? \'value " +
       "must be greater than %s or less than %s\'" +
-      ".format([rules.gt, rules.lt]) : \'\'\n\304\001\n\rs" +
-      "int64.gt_lte\032\262\001has(rules.lte) && rules.l" +
-      "te >= rules.gt && (this > rules.lte || t" +
-      "his <= rules.gt)? \'value must be greater" +
-      " than %s and less than or equal to %s\'.f" +
-      "ormat([rules.gt, rules.lte]) : \'\'\n\314\001\n\027si" +
-      "nt64.gt_lte_exclusive\032\260\001has(rules.lte) &" +
-      "& rules.lte < rules.gt && (rules.lte < t" +
-      "his && this <= rules.gt)? \'value must be" +
-      " greater than %s or less than or equal t" +
-      "o %s\'.format([rules.gt, rules.lte]) : \'\'" +
-      "H\001R\002gt\022\355\007\n\003gte\030\005 \001(\022B\330\007\302H\324\007\n\211\001\n\nsint64.g" +
-      "te\032{!has(rules.lt) && !has(rules.lte) &&" +
-      " this < rules.gte? \'value must be greate" +
-      "r than or equal to %s\'.format([rules.gte" +
-      "]) : \'\'\n\303\001\n\rsint64.gte_lt\032\261\001has(rules.lt" +
-      ") && rules.lt >= rules.gte && (this >= r" +
-      "ules.lt || this < rules.gte)? \'value mus" +
-      "t be greater than or equal to %s and les" +
-      "s than %s\'.format([rules.gte, rules.lt])" +
-      " : \'\'\n\313\001\n\027sint64.gte_lt_exclusive\032\257\001has(" +
-      "rules.lt) && rules.lt < rules.gte && (ru" +
-      "les.lt <= this && this < rules.gte)? \'va" +
-      "lue must be greater than or equal to %s " +
-      "or less than %s\'.format([rules.gte, rule" +
-      "s.lt]) : \'\'\n\323\001\n\016sint64.gte_lte\032\300\001has(rul" +
-      "es.lte) && rules.lte >= rules.gte && (th" +
-      "is > rules.lte || this < rules.gte)? \'va" +
-      "lue must be greater than or equal to %s " +
-      "and less than or equal to %s\'.format([ru" +
-      "les.gte, rules.lte]) : \'\'\n\333\001\n\030sint64.gte" +
-      "_lte_exclusive\032\276\001has(rules.lte) && rules" +
-      ".lte < rules.gte && (rules.lte < this &&" +
-      " this < rules.gte)? \'value must be great" +
-      "er than or equal to %s or less than or e" +
-      "qual to %s\'.format([rules.gte, rules.lte" +
-      "]) : \'\'H\001R\003gte\022z\n\002in\030\006 \003(\022Bj\302Hg\ne\n\tsint6" +
-      "4.in\032X!(this in dyn(rules)[\'in\']) ? \'val" +
-      "ue must be in list %s\'.format([dyn(rules" +
-      ")[\'in\']]) : \'\'R\002in\022~\n\006not_in\030\007 \003(\022Bg\302Hd\n" +
-      "b\n\rsint64.not_in\032Qthis in rules.not_in ?" +
-      " \'value must not be in list %s\'.format([" +
-      "rules.not_in]) : \'\'R\005notInB\013\n\tless_thanB" +
-      "\016\n\014greater_thanB\010\n\006_const\"\202\025\n\014Fixed32Rul" +
-      "es\022w\n\005const\030\001 \001(\007B\\\302HY\nW\n\rfixed32.const\032" +
-      "Fthis != rules.const ? \'value must equal" +
-      " %s\'.format([rules.const]) : \'\'H\002R\005const" +
-      "\210\001\001\022\220\001\n\002lt\030\002 \001(\007B~\302H{\ny\n\nfixed32.lt\032k!ha" +
-      "s(rules.gte) && !has(rules.gt) && this >" +
-      "= rules.lt? \'value must be less than %s\'" +
-      ".format([rules.lt]) : \'\'H\000R\002lt\022\243\001\n\003lte\030\003" +
-      " \001(\007B\216\001\302H\212\001\n\207\001\n\013fixed32.lte\032x!has(rules." +
-      "gte) && !has(rules.gt) && this > rules.l" +
-      "te? \'value must be less than or equal to" +
-      " %s\'.format([rules.lte]) : \'\'H\000R\003lte\022\245\007\n" +
-      "\002gt\030\004 \001(\007B\222\007\302H\216\007\n|\n\nfixed32.gt\032n!has(rul" +
-      "es.lt) && !has(rules.lte) && this <= rul" +
-      "es.gt? \'value must be greater than %s\'.f" +
-      "ormat([rules.gt]) : \'\'\n\265\001\n\rfixed32.gt_lt" +
-      "\032\243\001has(rules.lt) && rules.lt >= rules.gt" +
-      " && (this >= rules.lt || this <= rules.g" +
-      "t)? \'value must be greater than %s and l" +
-      "ess than %s\'.format([rules.gt, rules.lt]" +
-      ") : \'\'\n\275\001\n\027fixed32.gt_lt_exclusive\032\241\001has" +
-      "(rules.lt) && rules.lt < rules.gt && (ru" +
-      "les.lt <= this && this <= rules.gt)? \'va" +
-      "lue must be greater than %s or less than" +
-      " %s\'.format([rules.gt, rules.lt]) : \'\'\n\305" +
-      "\001\n\016fixed32.gt_lte\032\262\001has(rules.lte) && ru" +
-      "les.lte >= rules.gt && (this > rules.lte" +
-      " || this <= rules.gt)? \'value must be gr" +
-      "eater than %s and less than or equal to " +
-      "%s\'.format([rules.gt, rules.lte]) : \'\'\n\315" +
-      "\001\n\030fixed32.gt_lte_exclusive\032\260\001has(rules." +
-      "lte) && rules.lte < rules.gt && (rules.l" +
-      "te < this && this <= rules.gt)? \'value m" +
-      "ust be greater than %s or less than or e" +
-      "qual to %s\'.format([rules.gt, rules.lte]" +
-      ") : \'\'H\001R\002gt\022\362\007\n\003gte\030\005 \001(\007B\335\007\302H\331\007\n\212\001\n\013fi" +
-      "xed32.gte\032{!has(rules.lt) && !has(rules." +
-      "lte) && this < rules.gte? \'value must be" +
-      " greater than or equal to %s\'.format([ru" +
-      "les.gte]) : \'\'\n\304\001\n\016fixed32.gte_lt\032\261\001has(" +
-      "rules.lt) && rules.lt >= rules.gte && (t" +
-      "his >= rules.lt || this < rules.gte)? \'v" +
-      "alue must be greater than or equal to %s" +
-      " and less than %s\'.format([rules.gte, ru" +
-      "les.lt]) : \'\'\n\314\001\n\030fixed32.gte_lt_exclusi" +
-      "ve\032\257\001has(rules.lt) && rules.lt < rules.g" +
-      "te && (rules.lt <= this && this < rules." +
-      "gte)? \'value must be greater than or equ" +
-      "al to %s or less than %s\'.format([rules." +
-      "gte, rules.lt]) : \'\'\n\324\001\n\017fixed32.gte_lte" +
-      "\032\300\001has(rules.lte) && rules.lte >= rules." +
-      "gte && (this > rules.lte || this < rules" +
-      ".gte)? \'value must be greater than or eq" +
-      "ual to %s and less than or equal to %s\'." +
-      "format([rules.gte, rules.lte]) : \'\'\n\334\001\n\031" +
-      "fixed32.gte_lte_exclusive\032\276\001has(rules.lt" +
-      "e) && rules.lte < rules.gte && (rules.lt" +
-      "e < this && this < rules.gte)? \'value mu" +
-      "st be greater than or equal to %s or les" +
-      "s than or equal to %s\'.format([rules.gte" +
-      ", rules.lte]) : \'\'H\001R\003gte\022{\n\002in\030\006 \003(\007Bk\302" +
-      "Hh\nf\n\nfixed32.in\032X!(this in dyn(rules)[\'" +
-      "in\']) ? \'value must be in list %s\'.forma" +
-      "t([dyn(rules)[\'in\']]) : \'\'R\002in\022\177\n\006not_in" +
-      "\030\007 \003(\007Bh\302He\nc\n\016fixed32.not_in\032Qthis in r" +
-      "ules.not_in ? \'value must not be in list" +
-      " %s\'.format([rules.not_in]) : \'\'R\005notInB" +
-      "\013\n\tless_thanB\016\n\014greater_thanB\010\n\006_const\"\202" +
-      "\025\n\014Fixed64Rules\022w\n\005const\030\001 \001(\006B\\\302HY\nW\n\rf" +
-      "ixed64.const\032Fthis != rules.const ? \'val" +
-      "ue must equal %s\'.format([rules.const]) " +
-      ": \'\'H\002R\005const\210\001\001\022\220\001\n\002lt\030\002 \001(\006B~\302H{\ny\n\nfi" +
-      "xed64.lt\032k!has(rules.gte) && !has(rules." +
-      "gt) && this >= rules.lt? \'value must be " +
-      "less than %s\'.format([rules.lt]) : \'\'H\000R" +
-      "\002lt\022\243\001\n\003lte\030\003 \001(\006B\216\001\302H\212\001\n\207\001\n\013fixed64.lte" +
-      "\032x!has(rules.gte) && !has(rules.gt) && t" +
-      "his > rules.lte? \'value must be less tha" +
-      "n or equal to %s\'.format([rules.lte]) : " +
-      "\'\'H\000R\003lte\022\245\007\n\002gt\030\004 \001(\006B\222\007\302H\216\007\n|\n\nfixed64" +
-      ".gt\032n!has(rules.lt) && !has(rules.lte) &" +
-      "& this <= rules.gt? \'value must be great" +
-      "er than %s\'.format([rules.gt]) : \'\'\n\265\001\n\r" +
-      "fixed64.gt_lt\032\243\001has(rules.lt) && rules.l" +
-      "t >= rules.gt && (this >= rules.lt || th" +
-      "is <= rules.gt)? \'value must be greater " +
-      "than %s and less than %s\'.format([rules." +
-      "gt, rules.lt]) : \'\'\n\275\001\n\027fixed64.gt_lt_ex" +
-      "clusive\032\241\001has(rules.lt) && rules.lt < ru" +
-      "les.gt && (rules.lt <= this && this <= r" +
-      "ules.gt)? \'value must be greater than %s" +
-      " or less than %s\'.format([rules.gt, rule" +
-      "s.lt]) : \'\'\n\305\001\n\016fixed64.gt_lte\032\262\001has(rul" +
-      "es.lte) && rules.lte >= rules.gt && (thi" +
-      "s > rules.lte || this <= rules.gt)? \'val" +
-      "ue must be greater than %s and less than" +
-      " or equal to %s\'.format([rules.gt, rules" +
-      ".lte]) : \'\'\n\315\001\n\030fixed64.gt_lte_exclusive" +
-      "\032\260\001has(rules.lte) && rules.lte < rules.g" +
-      "t && (rules.lte < this && this <= rules." +
-      "gt)? \'value must be greater than %s or l" +
-      "ess than or equal to %s\'.format([rules.g" +
-      "t, rules.lte]) : \'\'H\001R\002gt\022\362\007\n\003gte\030\005 \001(\006B" +
-      "\335\007\302H\331\007\n\212\001\n\013fixed64.gte\032{!has(rules.lt) &" +
-      "& !has(rules.lte) && this < rules.gte? \'" +
-      "value must be greater than or equal to %" +
-      "s\'.format([rules.gte]) : \'\'\n\304\001\n\016fixed64." +
-      "gte_lt\032\261\001has(rules.lt) && rules.lt >= ru" +
-      "les.gte && (this >= rules.lt || this < r" +
-      "ules.gte)? \'value must be greater than o" +
-      "r equal to %s and less than %s\'.format([" +
-      "rules.gte, rules.lt]) : \'\'\n\314\001\n\030fixed64.g" +
-      "te_lt_exclusive\032\257\001has(rules.lt) && rules" +
-      ".lt < rules.gte && (rules.lt <= this && " +
-      "this < rules.gte)? \'value must be greate" +
-      "r than or equal to %s or less than %s\'.f" +
-      "ormat([rules.gte, rules.lt]) : \'\'\n\324\001\n\017fi" +
-      "xed64.gte_lte\032\300\001has(rules.lte) && rules." +
-      "lte >= rules.gte && (this > rules.lte ||" +
-      " this < rules.gte)? \'value must be great" +
-      "er than or equal to %s and less than or " +
-      "equal to %s\'.format([rules.gte, rules.lt" +
-      "e]) : \'\'\n\334\001\n\031fixed64.gte_lte_exclusive\032\276" +
-      "\001has(rules.lte) && rules.lte < rules.gte" +
-      " && (rules.lte < this && this < rules.gt" +
-      "e)? \'value must be greater than or equal" +
-      " to %s or less than or equal to %s\'.form" +
-      "at([rules.gte, rules.lte]) : \'\'H\001R\003gte\022{" +
-      "\n\002in\030\006 \003(\006Bk\302Hh\nf\n\nfixed64.in\032X!(this in" +
-      " dyn(rules)[\'in\']) ? \'value must be in l" +
-      "ist %s\'.format([dyn(rules)[\'in\']]) : \'\'R" +
-      "\002in\022\177\n\006not_in\030\007 \003(\006Bh\302He\nc\n\016fixed64.not_" +
-      "in\032Qthis in rules.not_in ? \'value must n" +
-      "ot be in list %s\'.format([rules.not_in])" +
-      " : \'\'R\005notInB\013\n\tless_thanB\016\n\014greater_tha" +
-      "nB\010\n\006_const\"\223\025\n\rSFixed32Rules\022x\n\005const\030\001" +
-      " \001(\017B]\302HZ\nX\n\016sfixed32.const\032Fthis != rul" +
-      "es.const ? \'value must equal %s\'.format(" +
-      "[rules.const]) : \'\'H\002R\005const\210\001\001\022\221\001\n\002lt\030\002" +
-      " \001(\017B\177\302H|\nz\n\013sfixed32.lt\032k!has(rules.gte" +
-      ") && !has(rules.gt) && this >= rules.lt?" +
-      " \'value must be less than %s\'.format([ru" +
-      "les.lt]) : \'\'H\000R\002lt\022\244\001\n\003lte\030\003 \001(\017B\217\001\302H\213\001" +
-      "\n\210\001\n\014sfixed32.lte\032x!has(rules.gte) && !h" +
-      "as(rules.gt) && this > rules.lte? \'value" +
-      " must be less than or equal to %s\'.forma" +
-      "t([rules.lte]) : \'\'H\000R\003lte\022\252\007\n\002gt\030\004 \001(\017B" +
-      "\227\007\302H\223\007\n}\n\013sfixed32.gt\032n!has(rules.lt) &&" +
-      " !has(rules.lte) && this <= rules.gt? \'v" +
-      "alue must be greater than %s\'.format([ru" +
-      "les.gt]) : \'\'\n\266\001\n\016sfixed32.gt_lt\032\243\001has(r" +
-      "ules.lt) && rules.lt >= rules.gt && (thi" +
-      "s >= rules.lt || this <= rules.gt)? \'val" +
-      "ue must be greater than %s and less than" +
-      " %s\'.format([rules.gt, rules.lt]) : \'\'\n\276" +
-      "\001\n\030sfixed32.gt_lt_exclusive\032\241\001has(rules." +
-      "lt) && rules.lt < rules.gt && (rules.lt " +
-      "<= this && this <= rules.gt)? \'value mus" +
-      "t be greater than %s or less than %s\'.fo" +
-      "rmat([rules.gt, rules.lt]) : \'\'\n\306\001\n\017sfix" +
-      "ed32.gt_lte\032\262\001has(rules.lte) && rules.lt" +
-      "e >= rules.gt && (this > rules.lte || th" +
-      "is <= rules.gt)? \'value must be greater " +
-      "than %s and less than or equal to %s\'.fo" +
-      "rmat([rules.gt, rules.lte]) : \'\'\n\316\001\n\031sfi" +
-      "xed32.gt_lte_exclusive\032\260\001has(rules.lte) " +
-      "&& rules.lte < rules.gt && (rules.lte < " +
-      "this && this <= rules.gt)? \'value must b" +
-      "e greater than %s or less than or equal " +
-      "to %s\'.format([rules.gt, rules.lte]) : \'" +
-      "\'H\001R\002gt\022\367\007\n\003gte\030\005 \001(\017B\342\007\302H\336\007\n\213\001\n\014sfixed3" +
-      "2.gte\032{!has(rules.lt) && !has(rules.lte)" +
-      " && this < rules.gte? \'value must be gre" +
-      "ater than or equal to %s\'.format([rules." +
-      "gte]) : \'\'\n\305\001\n\017sfixed32.gte_lt\032\261\001has(rul" +
-      "es.lt) && rules.lt >= rules.gte && (this" +
-      " >= rules.lt || this < rules.gte)? \'valu" +
-      "e must be greater than or equal to %s an" +
-      "d less than %s\'.format([rules.gte, rules" +
-      ".lt]) : \'\'\n\315\001\n\031sfixed32.gte_lt_exclusive" +
-      "\032\257\001has(rules.lt) && rules.lt < rules.gte" +
-      " && (rules.lt <= this && this < rules.gt" +
-      "e)? \'value must be greater than or equal" +
-      " to %s or less than %s\'.format([rules.gt" +
-      "e, rules.lt]) : \'\'\n\325\001\n\020sfixed32.gte_lte\032" +
-      "\300\001has(rules.lte) && rules.lte >= rules.g" +
-      "te && (this > rules.lte || this < rules." +
-      "gte)? \'value must be greater than or equ" +
-      "al to %s and less than or equal to %s\'.f" +
-      "ormat([rules.gte, rules.lte]) : \'\'\n\335\001\n\032s" +
-      "fixed32.gte_lte_exclusive\032\276\001has(rules.lt" +
-      "e) && rules.lte < rules.gte && (rules.lt" +
-      "e < this && this < rules.gte)? \'value mu" +
-      "st be greater than or equal to %s or les" +
-      "s than or equal to %s\'.format([rules.gte" +
-      ", rules.lte]) : \'\'H\001R\003gte\022|\n\002in\030\006 \003(\017Bl\302" +
-      "Hi\ng\n\013sfixed32.in\032X!(this in dyn(rules)[" +
-      "\'in\']) ? \'value must be in list %s\'.form" +
-      "at([dyn(rules)[\'in\']]) : \'\'R\002in\022\200\001\n\006not_" +
-      "in\030\007 \003(\017Bi\302Hf\nd\n\017sfixed32.not_in\032Qthis i" +
-      "n rules.not_in ? \'value must not be in l" +
-      "ist %s\'.format([rules.not_in]) : \'\'R\005not" +
-      "InB\013\n\tless_thanB\016\n\014greater_thanB\010\n\006_cons" +
-      "t\"\223\025\n\rSFixed64Rules\022x\n\005const\030\001 \001(\020B]\302HZ\n" +
-      "X\n\016sfixed64.const\032Fthis != rules.const ?" +
-      " \'value must equal %s\'.format([rules.con" +
-      "st]) : \'\'H\002R\005const\210\001\001\022\221\001\n\002lt\030\002 \001(\020B\177\302H|\n" +
-      "z\n\013sfixed64.lt\032k!has(rules.gte) && !has(" +
-      "rules.gt) && this >= rules.lt? \'value mu",
-      "st be less than %s\'.format([rules.lt]) :" +
-      " \'\'H\000R\002lt\022\244\001\n\003lte\030\003 \001(\020B\217\001\302H\213\001\n\210\001\n\014sfixe" +
-      "d64.lte\032x!has(rules.gte) && !has(rules.g" +
-      "t) && this > rules.lte? \'value must be l" +
-      "ess than or equal to %s\'.format([rules.l" +
-      "te]) : \'\'H\000R\003lte\022\252\007\n\002gt\030\004 \001(\020B\227\007\302H\223\007\n}\n\013" +
-      "sfixed64.gt\032n!has(rules.lt) && !has(rule" +
-      "s.lte) && this <= rules.gt? \'value must " +
-      "be greater than %s\'.format([rules.gt]) :" +
-      " \'\'\n\266\001\n\016sfixed64.gt_lt\032\243\001has(rules.lt) &" +
-      "& rules.lt >= rules.gt && (this >= rules" +
-      ".lt || this <= rules.gt)? \'value must be" +
-      " greater than %s and less than %s\'.forma" +
-      "t([rules.gt, rules.lt]) : \'\'\n\276\001\n\030sfixed6" +
-      "4.gt_lt_exclusive\032\241\001has(rules.lt) && rul" +
-      "es.lt < rules.gt && (rules.lt <= this &&" +
+      ".format([rules.gt, rules.lt]) : \'\'\n\306\001\n\017d" +
+      "uration.gt_lte\032\262\001has(rules.lte) && rules" +
+      ".lte >= rules.gt && (this > rules.lte ||" +
       " this <= rules.gt)? \'value must be great" +
-      "er than %s or less than %s\'.format([rule" +
-      "s.gt, rules.lt]) : \'\'\n\306\001\n\017sfixed64.gt_lt" +
-      "e\032\262\001has(rules.lte) && rules.lte >= rules" +
-      ".gt && (this > rules.lte || this <= rule" +
-      "s.gt)? \'value must be greater than %s an" +
-      "d less than or equal to %s\'.format([rule" +
-      "s.gt, rules.lte]) : \'\'\n\316\001\n\031sfixed64.gt_l" +
-      "te_exclusive\032\260\001has(rules.lte) && rules.l" +
-      "te < rules.gt && (rules.lte < this && th" +
-      "is <= rules.gt)? \'value must be greater " +
-      "than %s or less than or equal to %s\'.for" +
-      "mat([rules.gt, rules.lte]) : \'\'H\001R\002gt\022\367\007" +
-      "\n\003gte\030\005 \001(\020B\342\007\302H\336\007\n\213\001\n\014sfixed64.gte\032{!ha" +
+      "er than %s and less than or equal to %s\'" +
+      ".format([rules.gt, rules.lte]) : \'\'\n\316\001\n\031" +
+      "duration.gt_lte_exclusive\032\260\001has(rules.lt" +
+      "e) && rules.lte < rules.gt && (rules.lte" +
+      " < this && this <= rules.gt)? \'value mus" +
+      "t be greater than %s or less than or equ" +
+      "al to %s\'.format([rules.gt, rules.lte]) " +
+      ": \'\'H\001R\002gt\022\222\010\n\003gte\030\006 \001(\0132\031.google.protob" +
+      "uf.DurationB\342\007\302H\336\007\n\213\001\n\014duration.gte\032{!ha" +
       "s(rules.lt) && !has(rules.lte) && this <" +
       " rules.gte? \'value must be greater than " +
       "or equal to %s\'.format([rules.gte]) : \'\'" +
-      "\n\305\001\n\017sfixed64.gte_lt\032\261\001has(rules.lt) && " +
+      "\n\305\001\n\017duration.gte_lt\032\261\001has(rules.lt) && " +
       "rules.lt >= rules.gte && (this >= rules." +
       "lt || this < rules.gte)? \'value must be " +
       "greater than or equal to %s and less tha" +
       "n %s\'.format([rules.gte, rules.lt]) : \'\'" +
-      "\n\315\001\n\031sfixed64.gte_lt_exclusive\032\257\001has(rul" +
+      "\n\315\001\n\031duration.gte_lt_exclusive\032\257\001has(rul" +
       "es.lt) && rules.lt < rules.gte && (rules" +
       ".lt <= this && this < rules.gte)? \'value" +
       " must be greater than or equal to %s or " +
       "less than %s\'.format([rules.gte, rules.l" +
-      "t]) : \'\'\n\325\001\n\020sfixed64.gte_lte\032\300\001has(rule" +
+      "t]) : \'\'\n\325\001\n\020duration.gte_lte\032\300\001has(rule" +
       "s.lte) && rules.lte >= rules.gte && (thi" +
       "s > rules.lte || this < rules.gte)? \'val" +
       "ue must be greater than or equal to %s a" +
       "nd less than or equal to %s\'.format([rul" +
-      "es.gte, rules.lte]) : \'\'\n\335\001\n\032sfixed64.gt" +
+      "es.gte, rules.lte]) : \'\'\n\335\001\n\032duration.gt" +
       "e_lte_exclusive\032\276\001has(rules.lte) && rule" +
       "s.lte < rules.gte && (rules.lte < this &" +
       "& this < rules.gte)? \'value must be grea" +
       "ter than or equal to %s or less than or " +
       "equal to %s\'.format([rules.gte, rules.lt" +
-      "e]) : \'\'H\001R\003gte\022|\n\002in\030\006 \003(\020Bl\302Hi\ng\n\013sfix" +
-      "ed64.in\032X!(this in dyn(rules)[\'in\']) ? \'" +
-      "value must be in list %s\'.format([dyn(ru" +
-      "les)[\'in\']]) : \'\'R\002in\022\200\001\n\006not_in\030\007 \003(\020Bi" +
-      "\302Hf\nd\n\017sfixed64.not_in\032Qthis in rules.no" +
-      "t_in ? \'value must not be in list %s\'.fo" +
-      "rmat([rules.not_in]) : \'\'R\005notInB\013\n\tless" +
-      "_thanB\016\n\014greater_thanB\010\n\006_const\"\213\001\n\tBool" +
-      "Rules\022t\n\005const\030\001 \001(\010BY\302HV\nT\n\nbool.const\032" +
-      "Fthis != rules.const ? \'value must equal" +
-      " %s\'.format([rules.const]) : \'\'H\000R\005const" +
-      "\210\001\001B\010\n\006_const\"\350$\n\013StringRules\022x\n\005const\030\001" +
-      " \001(\tB]\302HZ\nX\n\014string.const\032Hthis != rules" +
-      ".const ? \'value must equal `%s`\'.format(" +
-      "[rules.const]) : \'\'H\001R\005const\210\001\001\022\210\001\n\003len\030" +
-      "\023 \001(\004Bq\302Hn\nl\n\nstring.len\032^uint(this.size" +
-      "()) != rules.len ? \'value length must be" +
-      " %s characters\'.format([rules.len]) : \'\'" +
-      "H\002R\003len\210\001\001\022\246\001\n\007min_len\030\002 \001(\004B\207\001\302H\203\001\n\200\001\n\016" +
-      "string.min_len\032nuint(this.size()) < rule" +
-      "s.min_len ? \'value length must be at lea" +
-      "st %s characters\'.format([rules.min_len]" +
-      ") : \'\'H\003R\006minLen\210\001\001\022\244\001\n\007max_len\030\003 \001(\004B\205\001" +
-      "\302H\201\001\n\177\n\016string.max_len\032muint(this.size()" +
-      ") > rules.max_len ? \'value length must b" +
-      "e at most %s characters\'.format([rules.m" +
-      "ax_len]) : \'\'H\004R\006maxLen\210\001\001\022\252\001\n\tlen_bytes" +
-      "\030\024 \001(\004B\207\001\302H\203\001\n\200\001\n\020string.len_bytes\032luint" +
-      "(bytes(this).size()) != rules.len_bytes " +
-      "? \'value length must be %s bytes\'.format" +
-      "([rules.len_bytes]) : \'\'H\005R\010lenBytes\210\001\001\022" +
-      "\262\001\n\tmin_bytes\030\004 \001(\004B\217\001\302H\213\001\n\210\001\n\020string.mi" +
-      "n_bytes\032tuint(bytes(this).size()) < rule" +
-      "s.min_bytes ? \'value length must be at l" +
-      "east %s bytes\'.format([rules.min_bytes])" +
-      " : \'\'H\006R\010minBytes\210\001\001\022\261\001\n\tmax_bytes\030\005 \001(\004" +
-      "B\216\001\302H\212\001\n\207\001\n\020string.max_bytes\032suint(bytes" +
-      "(this).size()) > rules.max_bytes ? \'valu" +
-      "e length must be at most %s bytes\'.forma" +
-      "t([rules.max_bytes]) : \'\'H\007R\010maxBytes\210\001\001" +
-      "\022\233\001\n\007pattern\030\006 \001(\tB|\302Hy\nw\n\016string.patter" +
-      "n\032e!this.matches(rules.pattern) ? \'value" +
-      " does not match regex pattern `%s`\'.form" +
-      "at([rules.pattern]) : \'\'H\010R\007pattern\210\001\001\022\221" +
-      "\001\n\006prefix\030\007 \001(\tBt\302Hq\no\n\rstring.prefix\032^!" +
-      "this.startsWith(rules.prefix) ? \'value d" +
-      "oes not have prefix `%s`\'.format([rules." +
-      "prefix]) : \'\'H\tR\006prefix\210\001\001\022\217\001\n\006suffix\030\010 " +
-      "\001(\tBr\302Ho\nm\n\rstring.suffix\032\\!this.endsWit" +
-      "h(rules.suffix) ? \'value does not have s" +
-      "uffix `%s`\'.format([rules.suffix]) : \'\'H" +
-      "\nR\006suffix\210\001\001\022\237\001\n\010contains\030\t \001(\tB~\302H{\ny\n\017" +
-      "string.contains\032f!this.contains(rules.co" +
-      "ntains) ? \'value does not contain substr" +
-      "ing `%s`\'.format([rules.contains]) : \'\'H" +
-      "\013R\010contains\210\001\001\022\252\001\n\014not_contains\030\027 \001(\tB\201\001" +
-      "\302H~\n|\n\023string.not_contains\032ethis.contain" +
-      "s(rules.not_contains) ? \'value contains " +
-      "substring `%s`\'.format([rules.not_contai" +
-      "ns]) : \'\'H\014R\013notContains\210\001\001\022z\n\002in\030\n \003(\tB" +
-      "j\302Hg\ne\n\tstring.in\032X!(this in dyn(rules)[" +
-      "\'in\']) ? \'value must be in list %s\'.form" +
-      "at([dyn(rules)[\'in\']]) : \'\'R\002in\022~\n\006not_i" +
-      "n\030\013 \003(\tBg\302Hd\nb\n\rstring.not_in\032Qthis in r" +
-      "ules.not_in ? \'value must not be in list" +
-      " %s\'.format([rules.not_in]) : \'\'R\005notIn\022" +
-      "`\n\005email\030\014 \001(\010BH\302HE\nC\n\014string.email\022#val" +
-      "ue must be a valid email address\032\016this.i" +
-      "sEmail()H\000R\005email\022g\n\010hostname\030\r \001(\010BI\302HF" +
-      "\nD\n\017string.hostname\022\036value must be a val" +
-      "id hostname\032\021this.isHostname()H\000R\010hostna" +
-      "me\022Q\n\002ip\030\016 \001(\010B?\302H<\n:\n\tstring.ip\022 value " +
-      "must be a valid IP address\032\013this.isIp()H" +
-      "\000R\002ip\022Z\n\004ipv4\030\017 \001(\010BD\302HA\n?\n\013string.ipv4\022" +
-      "\"value must be a valid IPv4 address\032\014thi" +
-      "s.isIp(4)H\000R\004ipv4\022Z\n\004ipv6\030\020 \001(\010BD\302HA\n?\n\013" +
-      "string.ipv6\022\"value must be a valid IPv6 " +
-      "address\032\014this.isIp(6)H\000R\004ipv6\022N\n\003uri\030\021 \001" +
-      "(\010B:\302H7\n5\n\nstring.uri\022\031value must be a v" +
-      "alid URI\032\014this.isUri()H\000R\003uri\022\\\n\007uri_ref" +
-      "\030\022 \001(\010BA\302H>\n<\n\016string.uri_ref\022\031value mus" +
-      "t be a valid URI\032\017this.isUriRef()H\000R\006uri" +
-      "Ref\022\202\001\n\007address\030\025 \001(\010Bf\302Hc\na\n\016string.add" +
-      "ress\022-value must be a valid hostname, or" +
-      " ip address\032 this.isHostname() || this.i" +
-      "sIp()H\000R\007address\022\260\001\n\004uuid\030\026 \001(\010B\231\001\302H\225\001\n\222" +
-      "\001\n\013string.uuid\032\202\001!this.matches(\'^[0-9a-f" +
-      "A-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0" +
-      "-9a-fA-F]{4}-[0-9a-fA-F]{12}$\') ? \'value" +
-      " must be a valid UUID\' : \'\'H\000R\004uuid\022\201\001\n\021" +
-      "ip_with_prefixlen\030\032 \001(\010BS\302HP\nN\n\030string.i" +
-      "p_with_prefixlen\022\037value must be a valid " +
-      "IP prefix\032\021this.isIpPrefix()H\000R\017ipWithPr" +
-      "efixlen\022\236\001\n\023ipv4_with_prefixlen\030\033 \001(\010Bl\302" +
-      "Hi\ng\n\032string.ipv4_with_prefixlen\0225value " +
-      "must be a valid IPv4 address with prefix" +
-      " length\032\022this.isIpPrefix(4)H\000R\021ipv4WithP" +
-      "refixlen\022\236\001\n\023ipv6_with_prefixlen\030\034 \001(\010Bl" +
-      "\302Hi\ng\n\032string.ipv6_with_prefixlen\0225value" +
-      " must be a valid IPv6 address with prefi" +
-      "x length\032\022this.isIpPrefix(6)H\000R\021ipv6With" +
-      "Prefixlen\022n\n\tip_prefix\030\035 \001(\010BO\302HL\nJ\n\020str" +
-      "ing.ip_prefix\022\037value must be a valid IP " +
-      "prefix\032\025this.isIpPrefix(true)H\000R\010ipPrefi" +
-      "x\022y\n\013ipv4_prefix\030\036 \001(\010BV\302HS\nQ\n\022string.ip" +
-      "v4_prefix\022!value must be a valid IPv4 pr" +
-      "efix\032\030this.isIpPrefix(4, true)H\000R\nipv4Pr" +
-      "efix\022y\n\013ipv6_prefix\030\037 \001(\010BV\302HS\nQ\n\022string" +
-      ".ipv6_prefix\022!value must be a valid IPv6" +
-      " prefix\032\030this.isIpPrefix(6, true)H\000R\nipv" +
-      "6Prefix\022\254\004\n\020well_known_regex\030\030 \001(\0162\030.buf" +
-      ".validate.KnownRegexB\345\003\302H\341\003\n\353\001\n#string.w" +
-      "ell_known_regex.header_name\032\303\001rules.well" +
-      "_known_regex == 1 && !this.matches(!has(" +
-      "rules.strict) || rules.strict ?\'^:?[0-9a" +
-      "-zA-Z!#$%&\\\'*+-.^_|~\\x60]+$\' :\'^[^\\u0000" +
-      "\\u000A\\u000D]+$\') ? \'value must be a val" +
-      "id HTTP header name\' : \'\'\n\360\001\n$string.wel" +
-      "l_known_regex.header_value\032\307\001rules.well_" +
-      "known_regex == 2 && !this.matches(!has(r" +
-      "ules.strict) || rules.strict ?\'^[^\\u0000" +
-      "-\\u0008\\u000A-\\u001F\\u007F]*$\' :\'^[^\\u00" +
-      "00\\u000A\\u000D]*$\') ? \'value must be a v" +
-      "alid HTTP header value\' : \'\'H\000R\016wellKnow" +
-      "nRegex\022\033\n\006strict\030\031 \001(\010H\rR\006strict\210\001\001B\014\n\nw" +
-      "ell_knownB\010\n\006_constB\006\n\004_lenB\n\n\010_min_lenB" +
-      "\n\n\010_max_lenB\014\n\n_len_bytesB\014\n\n_min_bytesB" +
-      "\014\n\n_max_bytesB\n\n\010_patternB\t\n\007_prefixB\t\n\007" +
-      "_suffixB\013\n\t_containsB\017\n\r_not_containsB\t\n" +
-      "\007_strict\"\332\016\n\nBytesRules\022r\n\005const\030\001 \001(\014BW" +
-      "\302HT\nR\n\013bytes.const\032Cthis != rules.const " +
-      "? \'value must be %x\'.format([rules.const" +
-      "]) : \'\'H\001R\005const\210\001\001\022\202\001\n\003len\030\r \001(\004Bk\302Hh\nf" +
-      "\n\tbytes.len\032Yuint(this.size()) != rules." +
-      "len ? \'value length must be %s bytes\'.fo" +
-      "rmat([rules.len]) : \'\'H\002R\003len\210\001\001\022\235\001\n\007min" +
-      "_len\030\002 \001(\004B\177\302H|\nz\n\rbytes.min_len\032iuint(t" +
-      "his.size()) < rules.min_len ? \'value len" +
-      "gth must be at least %s bytes\'.format([r" +
-      "ules.min_len]) : \'\'H\003R\006minLen\210\001\001\022\225\001\n\007max" +
-      "_len\030\003 \001(\004Bw\302Ht\nr\n\rbytes.max_len\032auint(t" +
-      "his.size()) > rules.max_len ? \'value mus" +
-      "t be at most %s bytes\'.format([rules.max" +
-      "_len]) : \'\'H\004R\006maxLen\210\001\001\022\236\001\n\007pattern\030\004 \001" +
-      "(\tB\177\302H|\nz\n\rbytes.pattern\032i!string(this)." +
-      "matches(rules.pattern) ? \'value must mat" +
-      "ch regex pattern `%s`\'.format([rules.pat" +
-      "tern]) : \'\'H\005R\007pattern\210\001\001\022\216\001\n\006prefix\030\005 \001" +
-      "(\014Bq\302Hn\nl\n\014bytes.prefix\032\\!this.startsWit" +
-      "h(rules.prefix) ? \'value does not have p" +
-      "refix %x\'.format([rules.prefix]) : \'\'H\006R" +
-      "\006prefix\210\001\001\022\214\001\n\006suffix\030\006 \001(\014Bo\302Hl\nj\n\014byte" +
-      "s.suffix\032Z!this.endsWith(rules.suffix) ?" +
-      " \'value does not have suffix %x\'.format(" +
-      "[rules.suffix]) : \'\'H\007R\006suffix\210\001\001\022\222\001\n\010co" +
-      "ntains\030\007 \001(\014Bq\302Hn\nl\n\016bytes.contains\032Z!th" +
-      "is.contains(rules.contains) ? \'value doe" +
-      "s not contain %x\'.format([rules.contains" +
-      "]) : \'\'H\010R\010contains\210\001\001\022\233\001\n\002in\030\010 \003(\014B\212\001\302H" +
-      "\206\001\n\203\001\n\010bytes.in\032wdyn(rules)[\'in\'].size()" +
-      " > 0 && !(this in dyn(rules)[\'in\']) ? \'v" +
-      "alue must be in list %s\'.format([dyn(rul" +
-      "es)[\'in\']]) : \'\'R\002in\022}\n\006not_in\030\t \003(\014Bf\302H" +
-      "c\na\n\014bytes.not_in\032Qthis in rules.not_in " +
-      "? \'value must not be in list %s\'.format(" +
-      "[rules.not_in]) : \'\'R\005notIn\022r\n\002ip\030\n \001(\010B" +
-      "`\302H]\n[\n\010bytes.ip\032Othis.size() != 4 && th" +
-      "is.size() != 16 ? \'value must be a valid" +
-      " IP address\' : \'\'H\000R\002ip\022e\n\004ipv4\030\013 \001(\010BO\302" +
-      "HL\nJ\n\nbytes.ipv4\032 rules.max_items ? \'value must cont" +
-      "ain no more than %s item(s)\'.format([rul" +
-      "es.max_items]) : \'\'H\001R\010maxItems\210\001\001\022l\n\006un" +
-      "ique\030\003 \001(\010BO\302HL\nJ\n\017repeated.unique\022(repe" +
-      "ated value must contain unique items\032\rth" +
-      "is.unique()H\002R\006unique\210\001\001\0229\n\005items\030\004 \001(\0132" +
-      "\036.buf.validate.FieldConstraintsH\003R\005items" +
-      "\210\001\001B\014\n\n_min_itemsB\014\n\n_max_itemsB\t\n\007_uniq" +
-      "ueB\010\n\006_items\"\361\003\n\010MapRules\022\236\001\n\tmin_pairs\030" +
-      "\001 \001(\004B|\302Hy\nw\n\rmap.min_pairs\032fuint(this.s" +
-      "ize()) < rules.min_pairs ? \'map must be " +
-      "at least %d entries\'.format([rules.min_p" +
-      "airs]) : \'\'H\000R\010minPairs\210\001\001\022\235\001\n\tmax_pairs" +
-      "\030\002 \001(\004B{\302Hx\nv\n\rmap.max_pairs\032euint(this." +
-      "size()) > rules.max_pairs ? \'map must be" +
-      " at most %d entries\'.format([rules.max_p" +
-      "airs]) : \'\'H\001R\010maxPairs\210\001\001\0227\n\004keys\030\004 \001(\013" +
-      "2\036.buf.validate.FieldConstraintsH\002R\004keys" +
-      "\210\001\001\022;\n\006values\030\005 \001(\0132\036.buf.validate.Field" +
-      "ConstraintsH\003R\006values\210\001\001B\014\n\n_min_pairsB\014" +
-      "\n\n_max_pairsB\007\n\005_keysB\t\n\007_values\"1\n\010AnyR" +
-      "ules\022\016\n\002in\030\002 \003(\tR\002in\022\025\n\006not_in\030\003 \003(\tR\005no" +
-      "tIn\"\322\026\n\rDurationRules\022\223\001\n\005const\030\002 \001(\0132\031." +
-      "google.protobuf.DurationB]\302HZ\nX\n\016duratio" +
-      "n.const\032Fthis != rules.const ? \'value mu" +
-      "st equal %s\'.format([rules.const]) : \'\'H" +
-      "\002R\005const\210\001\001\022\254\001\n\002lt\030\003 \001(\0132\031.google.protob" +
-      "uf.DurationB\177\302H|\nz\n\013duration.lt\032k!has(ru" +
-      "les.gte) && !has(rules.gt) && this >= ru" +
-      "les.lt? \'value must be less than %s\'.for" +
-      "mat([rules.lt]) : \'\'H\000R\002lt\022\277\001\n\003lte\030\004 \001(\013" +
-      "2\031.google.protobuf.DurationB\217\001\302H\213\001\n\210\001\n\014d" +
-      "uration.lte\032x!has(rules.gte) && !has(rul" +
-      "es.gt) && this > rules.lte? \'value must " +
-      "be less than or equal to %s\'.format([rul" +
-      "es.lte]) : \'\'H\000R\003lte\022\305\007\n\002gt\030\005 \001(\0132\031.goog" +
-      "le.protobuf.DurationB\227\007\302H\223\007\n}\n\013duration." +
-      "gt\032n!has(rules.lt) && !has(rules.lte) &&" +
-      " this <= rules.gt? \'value must be greate" +
-      "r than %s\'.format([rules.gt]) : \'\'\n\266\001\n\016d" +
-      "uration.gt_lt\032\243\001has(rules.lt) && rules.l" +
-      "t >= rules.gt && (this >= rules.lt || th" +
-      "is <= rules.gt)? \'value must be greater " +
-      "than %s and less than %s\'.format([rules." +
-      "gt, rules.lt]) : \'\'\n\276\001\n\030duration.gt_lt_e" +
-      "xclusive\032\241\001has(rules.lt) && rules.lt < r" +
-      "ules.gt && (rules.lt <= this && this <= " +
-      "rules.gt)? \'value must be greater than %" +
-      "s or less than %s\'.format([rules.gt, rul" +
-      "es.lt]) : \'\'\n\306\001\n\017duration.gt_lte\032\262\001has(r" +
-      "ules.lte) && rules.lte >= rules.gt && (t" +
-      "his > rules.lte || this <= rules.gt)? \'v" +
-      "alue must be greater than %s and less th" +
-      "an or equal to %s\'.format([rules.gt, rul" +
-      "es.lte]) : \'\'\n\316\001\n\031duration.gt_lte_exclus" +
-      "ive\032\260\001has(rules.lte) && rules.lte < rule" +
-      "s.gt && (rules.lte < this && this <= rul" +
-      "es.gt)? \'value must be greater than %s o" +
-      "r less than or equal to %s\'.format([rule" +
-      "s.gt, rules.lte]) : \'\'H\001R\002gt\022\222\010\n\003gte\030\006 \001" +
-      "(\0132\031.google.protobuf.DurationB\342\007\302H\336\007\n\213\001\n" +
-      "\014duration.gte\032{!has(rules.lt) && !has(ru" +
-      "les.lte) && this < rules.gte? \'value mus" +
-      "t be greater than or equal to %s\'.format" +
-      "([rules.gte]) : \'\'\n\305\001\n\017duration.gte_lt\032\261" +
-      "\001has(rules.lt) && rules.lt >= rules.gte " +
-      "&& (this >= rules.lt || this < rules.gte" +
-      ")? \'value must be greater than or equal " +
-      "to %s and less than %s\'.format([rules.gt" +
-      "e, rules.lt]) : \'\'\n\315\001\n\031duration.gte_lt_e" +
+      "e]) : \'\'H\001R\003gte\022\227\001\n\002in\030\007 \003(\0132\031.google.pr" +
+      "otobuf.DurationBl\302Hi\ng\n\013duration.in\032X!(t" +
+      "his in dyn(rules)[\'in\']) ? \'value must b" +
+      "e in list %s\'.format([dyn(rules)[\'in\']])" +
+      " : \'\'R\002in\022\233\001\n\006not_in\030\010 \003(\0132\031.google.prot" +
+      "obuf.DurationBi\302Hf\nd\n\017duration.not_in\032Qt" +
+      "his in rules.not_in ? \'value must not be" +
+      " in list %s\'.format([rules.not_in]) : \'\'" +
+      "R\005notInB\013\n\tless_thanB\016\n\014greater_thanB\010\n\006" +
+      "_const\"\312\027\n\016TimestampRules\022\225\001\n\005const\030\002 \001(",
+      "\0132\032.google.protobuf.TimestampB^\302H[\nY\n\017ti" +
+      "mestamp.const\032Fthis != rules.const ? \'va" +
+      "lue must equal %s\'.format([rules.const])" +
+      " : \'\'H\002R\005const\210\001\001\022\257\001\n\002lt\030\003 \001(\0132\032.google." +
+      "protobuf.TimestampB\200\001\302H}\n{\n\014timestamp.lt" +
+      "\032k!has(rules.gte) && !has(rules.gt) && t" +
+      "his >= rules.lt? \'value must be less tha" +
+      "n %s\'.format([rules.lt]) : \'\'H\000R\002lt\022\301\001\n\003" +
+      "lte\030\004 \001(\0132\032.google.protobuf.TimestampB\220\001" +
+      "\302H\214\001\n\211\001\n\rtimestamp.lte\032x!has(rules.gte) " +
+      "&& !has(rules.gt) && this > rules.lte? \'" +
+      "value must be less than or equal to %s\'." +
+      "format([rules.lte]) : \'\'H\000R\003lte\022a\n\006lt_no" +
+      "w\030\007 \001(\010BH\302HE\nC\n\020timestamp.lt_now\032/this >" +
+      " now ? \'value must be less than now\' : \'" +
+      "\'H\000R\005ltNow\022\313\007\n\002gt\030\005 \001(\0132\032.google.protobu" +
+      "f.TimestampB\234\007\302H\230\007\n~\n\014timestamp.gt\032n!has" +
+      "(rules.lt) && !has(rules.lte) && this <=" +
+      " rules.gt? \'value must be greater than %" +
+      "s\'.format([rules.gt]) : \'\'\n\267\001\n\017timestamp" +
+      ".gt_lt\032\243\001has(rules.lt) && rules.lt >= ru" +
+      "les.gt && (this >= rules.lt || this <= r" +
+      "ules.gt)? \'value must be greater than %s" +
+      " and less than %s\'.format([rules.gt, rul" +
+      "es.lt]) : \'\'\n\277\001\n\031timestamp.gt_lt_exclusi" +
+      "ve\032\241\001has(rules.lt) && rules.lt < rules.g" +
+      "t && (rules.lt <= this && this <= rules." +
+      "gt)? \'value must be greater than %s or l" +
+      "ess than %s\'.format([rules.gt, rules.lt]" +
+      ") : \'\'\n\307\001\n\020timestamp.gt_lte\032\262\001has(rules." +
+      "lte) && rules.lte >= rules.gt && (this >" +
+      " rules.lte || this <= rules.gt)? \'value " +
+      "must be greater than %s and less than or" +
+      " equal to %s\'.format([rules.gt, rules.lt" +
+      "e]) : \'\'\n\317\001\n\032timestamp.gt_lte_exclusive\032" +
+      "\260\001has(rules.lte) && rules.lte < rules.gt" +
+      " && (rules.lte < this && this <= rules.g" +
+      "t)? \'value must be greater than %s or le" +
+      "ss than or equal to %s\'.format([rules.gt" +
+      ", rules.lte]) : \'\'H\001R\002gt\022\230\010\n\003gte\030\006 \001(\0132\032" +
+      ".google.protobuf.TimestampB\347\007\302H\343\007\n\214\001\n\rti" +
+      "mestamp.gte\032{!has(rules.lt) && !has(rule" +
+      "s.lte) && this < rules.gte? \'value must " +
+      "be greater than or equal to %s\'.format([" +
+      "rules.gte]) : \'\'\n\306\001\n\020timestamp.gte_lt\032\261\001" +
+      "has(rules.lt) && rules.lt >= rules.gte &" +
+      "& (this >= rules.lt || this < rules.gte)" +
+      "? \'value must be greater than or equal t" +
+      "o %s and less than %s\'.format([rules.gte" +
+      ", rules.lt]) : \'\'\n\316\001\n\032timestamp.gte_lt_e" +
       "xclusive\032\257\001has(rules.lt) && rules.lt < r" +
       "ules.gte && (rules.lt <= this && this < " +
       "rules.gte)? \'value must be greater than " +
       "or equal to %s or less than %s\'.format([" +
-      "rules.gte, rules.lt]) : \'\'\n\325\001\n\020duration." +
-      "gte_lte\032\300\001has(rules.lte) && rules.lte >=" +
-      " rules.gte && (this > rules.lte || this " +
-      "< rules.gte)? \'value must be greater tha" +
-      "n or equal to %s and less than or equal " +
-      "to %s\'.format([rules.gte, rules.lte]) : " +
-      "\'\'\n\335\001\n\032duration.gte_lte_exclusive\032\276\001has(" +
-      "rules.lte) && rules.lte < rules.gte && (" +
-      "rules.lte < this && this < rules.gte)? \'" +
-      "value must be greater than or equal to %" +
-      "s or less than or equal to %s\'.format([r" +
-      "ules.gte, rules.lte]) : \'\'H\001R\003gte\022\227\001\n\002in" +
-      "\030\007 \003(\0132\031.google.protobuf.DurationBl\302Hi\ng" +
-      "\n\013duration.in\032X!(this in dyn(rules)[\'in\'" +
-      "]) ? \'value must be in list %s\'.format([" +
-      "dyn(rules)[\'in\']]) : \'\'R\002in\022\233\001\n\006not_in\030\010" +
-      " \003(\0132\031.google.protobuf.DurationBi\302Hf\nd\n\017" +
-      "duration.not_in\032Qthis in rules.not_in ? " +
-      "\'value must not be in list %s\'.format([r" +
-      "ules.not_in]) : \'\'R\005notInB\013\n\tless_thanB\016" +
-      "\n\014greater_thanB\010\n\006_const\"\312\027\n\016TimestampRu" +
-      "les\022\225\001\n\005const\030\002 \001(\0132\032.google.protobuf.Ti" +
-      "mestampB^\302H[\nY\n\017timestamp.const\032Fthis !=" +
-      " rules.const ? \'value must equal %s\'.for" +
-      "mat([rules.const]) : \'\'H\002R\005const\210\001\001\022\257\001\n\002" +
-      "lt\030\003 \001(\0132\032.google.protobuf.TimestampB\200\001\302" +
-      "H}\n{\n\014timestamp.lt\032k!has(rules.gte) && !" +
-      "has(rules.gt) && this >= rules.lt? \'valu" +
-      "e must be less than %s\'.format([rules.lt" +
-      "]) : \'\'H\000R\002lt\022\301\001\n\003lte\030\004 \001(\0132\032.google.pro" +
-      "tobuf.TimestampB\220\001\302H\214\001\n\211\001\n\rtimestamp.lte" +
-      "\032x!has(rules.gte) && !has(rules.gt) && t" +
-      "his > rules.lte? \'value must be less tha" +
-      "n or equal to %s\'.format([rules.lte]) : " +
-      "\'\'H\000R\003lte\022a\n\006lt_now\030\007 \001(\010BH\302HE\nC\n\020timest" +
-      "amp.lt_now\032/this > now ? \'value must be " +
-      "less than now\' : \'\'H\000R\005ltNow\022\313\007\n\002gt\030\005 \001(" +
-      "\0132\032.google.protobuf.TimestampB\234\007\302H\230\007\n~\n\014" +
-      "timestamp.gt\032n!has(rules.lt) && !has(rul" +
-      "es.lte) && this <= rules.gt? \'value must" +
-      " be greater than %s\'.format([rules.gt]) " +
-      ": \'\'\n\267\001\n\017timestamp.gt_lt\032\243\001has(rules.lt)" +
-      " && rules.lt >= rules.gt && (this >= rul" +
-      "es.lt || this <= rules.gt)? \'value must " +
-      "be greater than %s and less than %s\'.for" +
-      "mat([rules.gt, rules.lt]) : \'\'\n\277\001\n\031times" +
-      "tamp.gt_lt_exclusive\032\241\001has(rules.lt) && " +
-      "rules.lt < rules.gt && (rules.lt <= this" +
-      " && this <= rules.gt)? \'value must be gr" +
-      "eater than %s or less than %s\'.format([r" +
-      "ules.gt, rules.lt]) : \'\'\n\307\001\n\020timestamp.g" +
-      "t_lte\032\262\001has(rules.lte) && rules.lte >= r" +
-      "ules.gt && (this > rules.lte || this <= " +
-      "rules.gt)? \'value must be greater than %" +
-      "s and less than or equal to %s\'.format([" +
-      "rules.gt, rules.lte]) : \'\'\n\317\001\n\032timestamp" +
-      ".gt_lte_exclusive\032\260\001has(rules.lte) && ru" +
-      "les.lte < rules.gt && (rules.lte < this " +
-      "&& this <= rules.gt)? \'value must be gre" +
-      "ater than %s or less than or equal to %s" +
-      "\'.format([rules.gt, rules.lte]) : \'\'H\001R\002" +
-      "gt\022\230\010\n\003gte\030\006 \001(\0132\032.google.protobuf.Times" +
-      "tampB\347\007\302H\343\007\n\214\001\n\rtimestamp.gte\032{!has(rule" +
-      "s.lt) && !has(rules.lte) && this < rules" +
-      ".gte? \'value must be greater than or equ" +
-      "al to %s\'.format([rules.gte]) : \'\'\n\306\001\n\020t" +
-      "imestamp.gte_lt\032\261\001has(rules.lt) && rules" +
-      ".lt >= rules.gte && (this >= rules.lt ||" +
-      " this < rules.gte)? \'value must be great" +
-      "er than or equal to %s and less than %s\'" +
-      ".format([rules.gte, rules.lt]) : \'\'\n\316\001\n\032" +
-      "timestamp.gte_lt_exclusive\032\257\001has(rules.l" +
-      "t) && rules.lt < rules.gte && (rules.lt " +
-      "<= this && this < rules.gte)? \'value mus" +
-      "t be greater than or equal to %s or less" +
-      " than %s\'.format([rules.gte, rules.lt]) " +
-      ": \'\'\n\326\001\n\021timestamp.gte_lte\032\300\001has(rules.l" +
-      "te) && rules.lte >= rules.gte && (this >",
-      " rules.lte || this < rules.gte)? \'value " +
-      "must be greater than or equal to %s and " +
-      "less than or equal to %s\'.format([rules." +
-      "gte, rules.lte]) : \'\'\n\336\001\n\033timestamp.gte_" +
-      "lte_exclusive\032\276\001has(rules.lte) && rules." +
-      "lte < rules.gte && (rules.lte < this && " +
-      "this < rules.gte)? \'value must be greate" +
-      "r than or equal to %s or less than or eq" +
-      "ual to %s\'.format([rules.gte, rules.lte]" +
-      ") : \'\'H\001R\003gte\022d\n\006gt_now\030\010 \001(\010BK\302HH\nF\n\020ti" +
-      "mestamp.gt_now\0322this < now ? \'value must" +
-      " be greater than now\' : \'\'H\001R\005gtNow\022\305\001\n\006" +
-      "within\030\t \001(\0132\031.google.protobuf.DurationB" +
-      "\214\001\302H\210\001\n\205\001\n\020timestamp.within\032qthis < now-" +
-      "rules.within || this > now+rules.within " +
-      "? \'value must be within %s of now\'.forma" +
-      "t([rules.within]) : \'\'H\003R\006within\210\001\001B\013\n\tl" +
-      "ess_thanB\016\n\014greater_thanB\010\n\006_constB\t\n\007_w" +
-      "ithin*n\n\nKnownRegex\022\033\n\027KNOWN_REGEX_UNSPE" +
-      "CIFIED\020\000\022 \n\034KNOWN_REGEX_HTTP_HEADER_NAME" +
-      "\020\001\022!\n\035KNOWN_REGEX_HTTP_HEADER_VALUE\020\002:_\n" +
-      "\007message\022\037.google.protobuf.MessageOption" +
-      "s\030\207\t \001(\0132 .buf.validate.MessageConstrain" +
-      "tsR\007message\210\001\001:W\n\005oneof\022\035.google.protobu" +
-      "f.OneofOptions\030\207\t \001(\0132\036.buf.validate.One" +
-      "ofConstraintsR\005oneof\210\001\001:W\n\005field\022\035.googl" +
-      "e.protobuf.FieldOptions\030\207\t \001(\0132\036.buf.val" +
-      "idate.FieldConstraintsR\005field\210\001\001Bn\n\022buil" +
-      "d.buf.validateB\rValidateProtoP\001ZGbuf.bui" +
-      "ld/gen/go/bufbuild/protovalidate/protoco" +
-      "lbuffers/go/buf/validateb\006proto3"
+      "rules.gte, rules.lt]) : \'\'\n\326\001\n\021timestamp" +
+      ".gte_lte\032\300\001has(rules.lte) && rules.lte >" +
+      "= rules.gte && (this > rules.lte || this" +
+      " < rules.gte)? \'value must be greater th" +
+      "an or equal to %s and less than or equal" +
+      " to %s\'.format([rules.gte, rules.lte]) :" +
+      " \'\'\n\336\001\n\033timestamp.gte_lte_exclusive\032\276\001ha" +
+      "s(rules.lte) && rules.lte < rules.gte &&" +
+      " (rules.lte < this && this < rules.gte)?" +
+      " \'value must be greater than or equal to" +
+      " %s or less than or equal to %s\'.format(" +
+      "[rules.gte, rules.lte]) : \'\'H\001R\003gte\022d\n\006g" +
+      "t_now\030\010 \001(\010BK\302HH\nF\n\020timestamp.gt_now\0322th" +
+      "is < now ? \'value must be greater than n" +
+      "ow\' : \'\'H\001R\005gtNow\022\305\001\n\006within\030\t \001(\0132\031.goo" +
+      "gle.protobuf.DurationB\214\001\302H\210\001\n\205\001\n\020timesta" +
+      "mp.within\032qthis < now-rules.within || th" +
+      "is > now+rules.within ? \'value must be w" +
+      "ithin %s of now\'.format([rules.within]) " +
+      ": \'\'H\003R\006within\210\001\001B\013\n\tless_thanB\016\n\014greate" +
+      "r_thanB\010\n\006_constB\t\n\007_within*\235\001\n\006Ignore\022\026" +
+      "\n\022IGNORE_UNSPECIFIED\020\000\022\031\n\025IGNORE_IF_UNPO" +
+      "PULATED\020\001\022\033\n\027IGNORE_IF_DEFAULT_VALUE\020\002\022\021" +
+      "\n\rIGNORE_ALWAYS\020\003\022\024\n\014IGNORE_EMPTY\020\001\032\002\010\001\022" +
+      "\026\n\016IGNORE_DEFAULT\020\002\032\002\010\001\032\002\020\001*n\n\nKnownRege" +
+      "x\022\033\n\027KNOWN_REGEX_UNSPECIFIED\020\000\022 \n\034KNOWN_" +
+      "REGEX_HTTP_HEADER_NAME\020\001\022!\n\035KNOWN_REGEX_" +
+      "HTTP_HEADER_VALUE\020\002:_\n\007message\022\037.google." +
+      "protobuf.MessageOptions\030\207\t \001(\0132 .buf.val" +
+      "idate.MessageConstraintsR\007message\210\001\001:W\n\005" +
+      "oneof\022\035.google.protobuf.OneofOptions\030\207\t " +
+      "\001(\0132\036.buf.validate.OneofConstraintsR\005one" +
+      "of\210\001\001:W\n\005field\022\035.google.protobuf.FieldOp" +
+      "tions\030\207\t \001(\0132\036.buf.validate.FieldConstra" +
+      "intsR\005field\210\001\001Bn\n\022build.buf.validateB\rVa" +
+      "lidateProtoP\001ZGbuf.build/gen/go/bufbuild" +
+      "/protovalidate/protocolbuffers/go/buf/va" +
+      "lidateb\006proto3"
     };
     descriptor = com.google.protobuf.Descriptors.FileDescriptor
       .internalBuildGeneratedFileFrom(descriptorData,
@@ -1453,7 +1514,7 @@ public static void registerAllExtensions(
     internal_static_buf_validate_FieldConstraints_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_buf_validate_FieldConstraints_descriptor,
-        new java.lang.String[] { "Cel", "Skipped", "Required", "IgnoreEmpty", "Float", "Double", "Int32", "Int64", "Uint32", "Uint64", "Sint32", "Sint64", "Fixed32", "Fixed64", "Sfixed32", "Sfixed64", "Bool", "String", "Bytes", "Enum", "Repeated", "Map", "Any", "Duration", "Timestamp", "Type", });
+        new java.lang.String[] { "Cel", "Required", "Ignore", "Float", "Double", "Int32", "Int64", "Uint32", "Uint64", "Sint32", "Sint64", "Fixed32", "Fixed64", "Sfixed32", "Sfixed64", "Bool", "String", "Bytes", "Enum", "Repeated", "Map", "Any", "Duration", "Timestamp", "Skipped", "IgnoreEmpty", "Type", });
     internal_static_buf_validate_FloatRules_descriptor =
       getDescriptor().getMessageTypes().get(3);
     internal_static_buf_validate_FloatRules_fieldAccessorTable = new
@@ -1537,7 +1598,7 @@ public static void registerAllExtensions(
     internal_static_buf_validate_StringRules_fieldAccessorTable = new
       com.google.protobuf.GeneratedMessageV3.FieldAccessorTable(
         internal_static_buf_validate_StringRules_descriptor,
-        new java.lang.String[] { "Const", "Len", "MinLen", "MaxLen", "LenBytes", "MinBytes", "MaxBytes", "Pattern", "Prefix", "Suffix", "Contains", "NotContains", "In", "NotIn", "Email", "Hostname", "Ip", "Ipv4", "Ipv6", "Uri", "UriRef", "Address", "Uuid", "IpWithPrefixlen", "Ipv4WithPrefixlen", "Ipv6WithPrefixlen", "IpPrefix", "Ipv4Prefix", "Ipv6Prefix", "WellKnownRegex", "Strict", "WellKnown", });
+        new java.lang.String[] { "Const", "Len", "MinLen", "MaxLen", "LenBytes", "MinBytes", "MaxBytes", "Pattern", "Prefix", "Suffix", "Contains", "NotContains", "In", "NotIn", "Email", "Hostname", "Ip", "Ipv4", "Ipv6", "Uri", "UriRef", "Address", "Uuid", "IpWithPrefixlen", "Ipv4WithPrefixlen", "Ipv6WithPrefixlen", "IpPrefix", "Ipv4Prefix", "Ipv6Prefix", "HostAndPort", "WellKnownRegex", "Strict", "WellKnown", });
     internal_static_buf_validate_BytesRules_descriptor =
       getDescriptor().getMessageTypes().get(17);
     internal_static_buf_validate_BytesRules_fieldAccessorTable = new
diff --git a/src/main/resources/buf/validate/validate.proto b/src/main/resources/buf/validate/validate.proto
index 35d65b76..09fa744b 100644
--- a/src/main/resources/buf/validate/validate.proto
+++ b/src/main/resources/buf/validate/validate.proto
@@ -131,27 +131,16 @@ message FieldConstraints {
   // }
   // ```
   repeated Constraint cel = 23;
-  // `skipped` is an optional boolean attribute that specifies that the
-  // validation rules of this field should not be evaluated. If skipped is set to
-  // true, any validation rules set for the field will be ignored.
+  // If `required` is true, the field must be populated. A populated field can be
+  // described as "serialized in the wire format," which includes:
   //
-  // ```proto
-  // message MyMessage {
-  //   // The field `value` must not be set.
-  //   optional MyOtherMessage value = 1 [(buf.validate.field).skipped = true];
-  // }
-  // ```
-  bool skipped = 24;
-  // If `required` is true, the field must be populated. Field presence can be
-  // described as "serialized in the wire format," which follows the following rules:
-  //
-  // - the following "nullable" fields must be explicitly set to be considered present:
-  //   - singular message fields (may be their empty value)
+  // - the following "nullable" fields must be explicitly set to be considered populated:
+  //   - singular message fields (whose fields may be unpopulated/default values)
   //   - member fields of a oneof (may be their default value)
   //   - proto3 optional fields (may be their default value)
-  //   - proto2 scalar fields
-  // - proto3 scalar fields must be non-zero to be considered present
-  // - repeated and map fields must be non-empty to be considered present
+  //   - proto2 scalar fields (both optional and required)
+  // - proto3 scalar fields must be non-zero to be considered populated
+  // - repeated and map fields must be non-empty to be considered populated
   //
   // ```proto
   // message MyMessage {
@@ -160,22 +149,21 @@ message FieldConstraints {
   // }
   // ```
   bool required = 25;
-  // If `ignore_empty` is true and applied to a non-nullable field (see
-  // `required` for more details), validation is skipped on the field if it is
-  // the default or empty value. Adding `ignore_empty` to a "nullable" field is
-  // a noop as these unset fields already skip validation (with the exception
-  // of `required`).
+  // Skip validation on the field if its value matches the specified criteria.
+  // See Ignore enum for details.
   //
   // ```proto
-  // message MyRepeated {
-  //   // The field `value` min_len rule is only applied if the field isn't empty.
-  //   repeated string value = 1 [
-  //     (buf.validate.field).ignore_empty = true,
-  //     (buf.validate.field).min_len = 5
+  // message UpdateRequest {
+  //   // The uri rule only applies if the field is populated and not an empty
+  //   // string.
+  //   optional string url = 1 [
+  //     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE,
+  //     (buf.validate.field).string.uri = true,
   //   ];
   // }
   // ```
-  bool ignore_empty = 26;
+  Ignore ignore = 27;
+
   oneof type {
     // Scalar Field Types
     FloatRules float = 1;
@@ -204,6 +192,165 @@ message FieldConstraints {
     DurationRules duration = 21;
     TimestampRules timestamp = 22;
   }
+
+  // DEPRECATED: use ignore=IGNORE_ALWAYS instead. TODO: remove this field pre-v1.
+  bool skipped = 24 [deprecated = true];
+  // DEPRECATED: use ignore=IGNORE_IF_UNPOPULATED instead. TODO: remove this field pre-v1.
+  bool ignore_empty = 26 [deprecated = true];
+}
+
+// Specifies how FieldConstraints.ignore behaves. See the documentation for
+// FieldConstraints.required for definitions of "populated" and "nullable".
+enum Ignore {
+  // buf:lint:ignore ENUM_NO_ALLOW_ALIAS // allowance for deprecations. TODO: remove pre-v1.
+  option allow_alias = true;
+  // Validation is only skipped if it's an unpopulated nullable fields.
+  //
+  // ```proto
+  // syntax="proto3";
+  //
+  // message Request {
+  //   // The uri rule applies to any value, including the empty string.
+  //   string foo = 1 [
+  //     (buf.validate.field).string.uri = true
+  //   ];
+  //
+  //   // The uri rule only applies if the field is set, including if it's
+  //   // set to the empty string.
+  //   optional string bar = 2 [
+  //     (buf.validate.field).string.uri = true
+  //   ];
+  //
+  //   // The min_items rule always applies, even if the list is empty.
+  //   repeated string baz = 3 [
+  //     (buf.validate.field).repeated.min_items = 3
+  //   ];
+  //
+  //   // The custom CEL rule applies only if the field is set, including if
+  //   // it's the "zero" value of that message.
+  //   SomeMessage quux = 4 [
+  //     (buf.validate.field).cel = {/* ... */}
+  //   ];
+  // }
+  // ```
+  IGNORE_UNSPECIFIED = 0;
+
+  // Validation is skipped if the field is unpopulated. This rule is redundant
+  // if the field is already nullable. This value is equivalent behavior to the
+  // deprecated ignore_empty rule.
+  //
+  // ```proto
+  // syntax="proto3
+  //
+  // message Request {
+  //   // The uri rule applies only if the value is not the empty string.
+  //   string foo = 1 [
+  //     (buf.validate.field).string.uri = true,
+  //     (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
+  //   ];
+  //
+  //   // IGNORE_IF_UNPOPULATED is equivalent to IGNORE_UNSPECIFIED in this
+  //   // case: the uri rule only applies if the field is set, including if
+  //   // it's set to the empty string.
+  //   optional string bar = 2 [
+  //     (buf.validate.field).string.uri = true,
+  //     (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
+  //   ];
+  //
+  //   // The min_items rule only applies if the list has at least one item.
+  //   repeated string baz = 3 [
+  //     (buf.validate.field).repeated.min_items = 3,
+  //     (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
+  //   ];
+  //
+  //   // IGNORE_IF_UNPOPULATED is equivalent to IGNORE_UNSPECIFIED in this
+  //   // case: the custom CEL rule applies only if the field is set, including
+  //   // if it's the "zero" value of that message.
+  //   SomeMessage quux = 4 [
+  //     (buf.validate.field).cel = {/* ... */},
+  //     (buf.validate.field).ignore = IGNORE_IF_UNPOPULATED
+  //   ];
+  // }
+  // ```
+  IGNORE_IF_UNPOPULATED = 1;
+
+  // Validation is skipped if the field is unpopulated or if it is a nullable
+  // field populated with its default value. This is typically the zero or
+  // empty value, but proto2 scalars support custom defaults. For messages, the
+  // default is a non-null message with all its fields unpopulated.
+  //
+  // ```proto
+  // syntax="proto3
+  //
+  // message Request {
+  //   // IGNORE_IF_DEFAULT_VALUE is equivalent to IGNORE_IF_UNPOPULATED in
+  //   // this case; the uri rule applies only if the value is not the empty
+  //   // string.
+  //   string foo = 1 [
+  //     (buf.validate.field).string.uri = true,
+  //     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+  //   ];
+  //
+  //   // The uri rule only applies if the field is set to a value other than
+  //   // the empty string.
+  //   optional string bar = 2 [
+  //     (buf.validate.field).string.uri = true,
+  //     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+  //   ];
+  //
+  //   // IGNORE_IF_DEFAULT_VALUE is equivalent to IGNORE_IF_UNPOPULATED in
+  //   // this case; the min_items rule only applies if the list has at least
+  //   // one item.
+  //   repeated string baz = 3 [
+  //     (buf.validate.field).repeated.min_items = 3,
+  //     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+  //   ];
+  //
+  //   // The custom CEL rule only applies if the field is set to a value other
+  //   // than an empty message (i.e., fields are unpopulated).
+  //   SomeMessage quux = 4 [
+  //     (buf.validate.field).cel = {/* ... */},
+  //     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+  //   ];
+  // }
+  // ```
+  //
+  // This rule is affected by proto2 custom default values:
+  //
+  // ```proto
+  // syntax="proto2";
+  //
+  // message Request {
+  //   // The gt rule only applies if the field is set and it's value is not
+  //   the default (i.e., not -42). The rule even applies if the field is set
+  //   to zero since the default value differs.
+  //   optional int32 value = 1 [
+  //     default = -42,
+  //     (buf.validate.field).int32.gt = 0,
+  //     (buf.validate.field).ignore = IGNORE_IF_DEFAULT_VALUE
+  //   ];
+  // }
+  IGNORE_IF_DEFAULT_VALUE = 2;
+
+  // The validation rules of this field will be skipped and not evaluated. This
+  // is useful for situations that necessitate turning off the rules of a field
+  // containing a message that may not make sense in the current context, or to
+  // temporarily disable constraints during development.
+  //
+  // ```proto
+  // message MyMessage {
+  //   // The field's rules will always be ignored, including any validation's
+  //   // on value's fields.
+  //   MyOtherMessage value = 1 [
+  //     (buf.validate.field).ignore = IGNORE_ALWAYS];
+  // }
+  // ```
+  IGNORE_ALWAYS = 3;
+
+  // Deprecated: Use IGNORE_IF_UNPOPULATED instead. TODO: Remove this value pre-v1.
+  IGNORE_EMPTY = 1 [deprecated = true];
+  // Deprecated: Use IGNORE_IF_DEFAULT_VALUE. TODO: Remove this value pre-v1.
+  IGNORE_DEFAULT = 2 [deprecated = true];
 }
 
 // FloatRules describes the constraints applied to `float` values. These
@@ -2694,11 +2841,18 @@ message StringRules {
     //   string value = 1 [(buf.validate.field).string.email = true];
     // }
     // ```
-    bool email = 12 [(priv.field).cel = {
-      id: "string.email",
-      message: "value must be a valid email address",
-      expression: "this.isEmail()"
-    }];
+    bool email = 12 [
+      (priv.field).cel = {
+        id: "string.email",
+        message: "value must be a valid email address",
+        expression: "this == '' || this.isEmail()",
+      },
+      (priv.field).cel = {
+        id: "string.email_empty",
+        message: "value is empty, which is not a valid email address",
+        expression: "this != ''",
+      }
+    ];
 
     // `hostname` specifies that the field value must be a valid
     // hostname as defined by [RFC 1034](https://tools.ietf.org/html/rfc1034#section-3.5). This constraint doesn't support
@@ -2711,11 +2865,18 @@ message StringRules {
     //   string value = 1 [(buf.validate.field).string.hostname = true];
     // }
     // ```
-    bool hostname = 13 [(priv.field).cel = {
-      id: "string.hostname",
-      message: "value must be a valid hostname",
-      expression: "this.isHostname()",
-    }];
+    bool hostname = 13 [
+      (priv.field).cel = {
+        id: "string.hostname",
+        message: "value must be a valid hostname",
+        expression: "this == '' || this.isHostname()",
+      },
+      (priv.field).cel = {
+        id: "string.hostname_empty",
+        message: "value is empty, which is not a valid hostname",
+        expression: "this != ''",
+      }
+    ];
 
     // `ip` specifies that the field value must be a valid IP
     // (v4 or v6) address, without surrounding square brackets for IPv6 addresses.
@@ -2728,11 +2889,18 @@ message StringRules {
     //   string value = 1 [(buf.validate.field).string.ip = true];
     // }
     // ```
-    bool ip = 14 [(priv.field).cel = {
-      id: "string.ip",
-      message: "value must be a valid IP address",
-      expression: "this.isIp()",
-    }];
+    bool ip = 14 [
+      (priv.field).cel = {
+        id: "string.ip",
+        message: "value must be a valid IP address",
+        expression: "this == '' || this.isIp()",
+      },
+      (priv.field).cel = {
+        id: "string.ip_empty",
+        message: "value is empty, which is not a valid IP address",
+        expression: "this != ''",
+      }
+    ];
 
     // `ipv4` specifies that the field value must be a valid IPv4
     // address. If the field value isn't a valid IPv4 address, an error message
@@ -2744,11 +2912,18 @@ message StringRules {
     //   string value = 1 [(buf.validate.field).string.ipv4 = true];
     // }
     // ```
-    bool ipv4 = 15 [(priv.field).cel = {
-      id: "string.ipv4",
-      message: "value must be a valid IPv4 address",
-      expression: "this.isIp(4)"
-    }];
+    bool ipv4 = 15 [
+      (priv.field).cel = {
+        id: "string.ipv4",
+        message: "value must be a valid IPv4 address",
+        expression: "this == '' || this.isIp(4)",
+      },
+      (priv.field).cel = {
+        id: "string.ipv4_empty",
+        message: "value is empty, which is not a valid IPv4 address",
+        expression: "this != ''",
+      }
+    ];
 
     // `ipv6` specifies that the field value must be a valid
     // IPv6 address, without surrounding square brackets. If the field value is
@@ -2760,11 +2935,18 @@ message StringRules {
     //   string value = 1 [(buf.validate.field).string.ipv6 = true];
     // }
     // ```
-    bool ipv6 = 16 [(priv.field).cel = {
-      id: "string.ipv6",
-      message: "value must be a valid IPv6 address",
-      expression: "this.isIp(6)",
-    }];
+    bool ipv6 = 16 [
+      (priv.field).cel = {
+        id: "string.ipv6",
+        message: "value must be a valid IPv6 address",
+        expression: "this == '' || this.isIp(6)",
+      },
+      (priv.field).cel = {
+        id: "string.ipv6_empty",
+        message: "value is empty, which is not a valid IPv6 address",
+        expression: "this != ''",
+      }
+    ];
 
     // `uri` specifies that the field value must be a valid,
     // absolute URI as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3). If the field value isn't a valid,
@@ -2776,11 +2958,18 @@ message StringRules {
     //   string value = 1 [(buf.validate.field).string.uri = true];
     // }
     // ```
-    bool uri = 17 [(priv.field).cel = {
-      id: "string.uri",
-      message: "value must be a valid URI",
-      expression: "this.isUri()",
-    }];
+    bool uri = 17 [
+      (priv.field).cel = {
+        id: "string.uri",
+        message: "value must be a valid URI",
+        expression: "this == '' || this.isUri()",
+      },
+      (priv.field).cel = {
+        id: "string.uri_empty",
+        message: "value is empty, which is not a valid URI",
+        expression: "this != ''",
+      }
+    ];
 
     // `uri_ref` specifies that the field value must be a valid URI
     // as defined by [RFC 3986](https://tools.ietf.org/html/rfc3986#section-3) and may be either relative or absolute. If the
@@ -2810,11 +2999,18 @@ message StringRules {
     //   string value = 1 [(buf.validate.field).string.address = true];
     // }
     // ```
-    bool address = 21 [(priv.field).cel = {
-      id: "string.address",
-      message: "value must be a valid hostname, or ip address",
-      expression: "this.isHostname() || this.isIp()",
-    }];
+    bool address = 21 [
+      (priv.field).cel = {
+        id: "string.address",
+        message: "value must be a valid hostname, or ip address",
+        expression: "this == '' || this.isHostname() || this.isIp()",
+      },
+      (priv.field).cel = {
+        id: "string.address_empty",
+        message: "value is empty, which is not a valid hostname, or ip address",
+        expression: "this != ''",
+      }
+    ];
 
     // `uuid` specifies that the field value must be a valid UUID as defined by
     // [RFC 4122](https://tools.ietf.org/html/rfc4122#section-4.1.2). If the
@@ -2826,10 +3022,18 @@ message StringRules {
     //   string value = 1 [(buf.validate.field).string.uuid = true];
     // }
     // ```
-    bool uuid = 22 [(priv.field).cel = {
-      id: "string.uuid",
-      expression: "!this.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$') ? 'value must be a valid UUID' : ''"
-    }];
+    bool uuid = 22 [
+      (priv.field).cel = {
+        id: "string.uuid",
+        message: "value must be a valid UUID",
+        expression: "this == '' || this.matches('^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$')",
+      },
+      (priv.field).cel = {
+        id: "string.uuid_empty",
+        message: "value is empty, which is not a valid UUID",
+        expression: "this != ''",
+      }
+    ];
 
     // `ip_with_prefixlen` specifies that the field value must be a valid IP (v4 or v6)
     // address with prefix length. If the field value isn't a valid IP with prefix
@@ -2842,11 +3046,18 @@ message StringRules {
     //    string value = 1 [(buf.validate.field).string.ip_with_prefixlen = true];
     // }
     // ```
-    bool ip_with_prefixlen = 26 [(priv.field).cel = {
-      id: "string.ip_with_prefixlen",
-      message: "value must be a valid IP prefix",
-      expression: "this.isIpPrefix()",
-    }];
+    bool ip_with_prefixlen = 26 [
+      (priv.field).cel = {
+        id: "string.ip_with_prefixlen",
+        message: "value must be a valid IP prefix",
+        expression: "this == '' || this.isIpPrefix()",
+      },
+      (priv.field).cel = {
+        id: "string.ip_with_prefixlen_empty",
+        message: "value is empty, which is not a valid IP prefix",
+        expression: "this != ''",
+      }
+    ];
 
     // `ipv4_with_prefixlen` specifies that the field value must be a valid
     // IPv4 address with prefix.
@@ -2855,15 +3066,22 @@ message StringRules {
     //
     // ```proto
     // message MyString {
-    //   // value must be a valid IPv4 address with prefix lentgh
+    //   // value must be a valid IPv4 address with prefix length
     //    string value = 1 [(buf.validate.field).string.ipv4_with_prefixlen = true];
     // }
     // ```
-    bool ipv4_with_prefixlen = 27 [(priv.field).cel = {
-      id: "string.ipv4_with_prefixlen",
-      message: "value must be a valid IPv4 address with prefix length",
-      expression: "this.isIpPrefix(4)"
-    }];
+    bool ipv4_with_prefixlen = 27 [
+      (priv.field).cel = {
+        id: "string.ipv4_with_prefixlen",
+        message: "value must be a valid IPv4 address with prefix length",
+        expression: "this == '' || this.isIpPrefix(4)"
+      },
+      (priv.field).cel = {
+        id: "string.ipv4_with_prefixlen_empty",
+        message: "value is empty, which is not a valid IPv4 address with prefix length",
+        expression: "this != ''"
+      }
+    ];
 
     // `ipv6_with_prefixlen` specifies that the field value must be a valid
     // IPv6 address with prefix length.
@@ -2876,11 +3094,18 @@ message StringRules {
     //    string value = 1 [(buf.validate.field).string.ipv6_with_prefixlen = true];
     // }
     // ```
-    bool ipv6_with_prefixlen = 28 [(priv.field).cel = {
-      id: "string.ipv6_with_prefixlen",
-      message: "value must be a valid IPv6 address with prefix length",
-      expression: "this.isIpPrefix(6)",
-    }];
+    bool ipv6_with_prefixlen = 28 [
+      (priv.field).cel = {
+        id: "string.ipv6_with_prefixlen",
+        message: "value must be a valid IPv6 address with prefix length",
+        expression: "this == '' || this.isIpPrefix(6)",
+      },
+      (priv.field).cel = {
+        id: "string.ipv6_with_prefixlen_empty",
+        message: "value is empty, which is not a valid IPv6 address with prefix length",
+        expression: "this != ''",
+      }
+    ];
 
     // `ip_prefix` specifies that the field value must be a valid IP (v4 or v6) prefix.
     // If the field value isn't a valid IP prefix, an error message will be
@@ -2893,11 +3118,18 @@ message StringRules {
     //    string value = 1 [(buf.validate.field).string.ip_prefix = true];
     // }
     // ```
-    bool ip_prefix = 29 [(priv.field).cel = {
-      id: "string.ip_prefix",
-      message: "value must be a valid IP prefix",
-      expression: "this.isIpPrefix(true)",
-    }];
+    bool ip_prefix = 29 [
+      (priv.field).cel = {
+        id: "string.ip_prefix",
+        message: "value must be a valid IP prefix",
+        expression: "this == '' || this.isIpPrefix(true)",
+      },
+      (priv.field).cel = {
+        id: "string.ip_prefix_empty",
+        message: "value is empty, which is not a valid IP prefix",
+        expression: "this != ''",
+      }
+    ];
 
     // `ipv4_prefix` specifies that the field value must be a valid IPv4
     // prefix. If the field value isn't a valid IPv4 prefix, an error message
@@ -2910,11 +3142,18 @@ message StringRules {
     //    string value = 1 [(buf.validate.field).string.ipv4_prefix = true];
     // }
     // ```
-    bool ipv4_prefix = 30 [(priv.field).cel = {
-      id: "string.ipv4_prefix",
-      message: "value must be a valid IPv4 prefix",
-      expression: "this.isIpPrefix(4, true)"
-    }];
+    bool ipv4_prefix = 30 [
+      (priv.field).cel = {
+        id: "string.ipv4_prefix",
+        message: "value must be a valid IPv4 prefix",
+        expression: "this == '' || this.isIpPrefix(4, true)"
+      },
+      (priv.field).cel = {
+        id: "string.ipv4_prefix_empty",
+        message: "value is empty, which is not a valid IPv4 prefix",
+        expression: "this != ''"
+      }
+    ];
 
     // `ipv6_prefix` specifies that the field value must be a valid IPv6 prefix.
     // If the field value is not a valid IPv6 prefix, an error message will be
@@ -2927,11 +3166,35 @@ message StringRules {
     //    string value = 1 [(buf.validate.field).string.ipv6_prefix = true];
     // }
     // ```
-    bool ipv6_prefix = 31 [(priv.field).cel = {
-      id: "string.ipv6_prefix",
-      message: "value must be a valid IPv6 prefix",
-      expression: "this.isIpPrefix(6, true)",
-    }];
+    bool ipv6_prefix = 31 [
+      (priv.field).cel = {
+        id: "string.ipv6_prefix",
+        message: "value must be a valid IPv6 prefix",
+        expression: "this == '' || this.isIpPrefix(6, true)",
+      },
+      (priv.field).cel = {
+        id: "string.ipv6_prefix_empty",
+        message: "value is empty, which is not a valid IPv6 prefix",
+        expression: "this != ''",
+      }
+    ];
+
+    // `host_and_port` specifies the field value must be a valid host and port
+    // pair. The host must be a valid hostname or IP address while the port
+    // must be in the range of 0-65535, inclusive. IPv6 addresses must be delimited
+    // with square brackets (e.g., `[::1]:1234`).
+    bool host_and_port = 32 [
+      (priv.field).cel = {
+        id: "string.host_and_port",
+        message: "value must be a valid host (hostname or IP address) and port pair",
+        expression: "this == '' || this.isHostAndPort(true)",
+      },
+      (priv.field).cel = {
+        id: "string.host_and_port_empty",
+        message: "value is empty, which is not a valid host and port pair",
+        expression: "this != ''",
+      }
+    ];
 
     // `well_known_regex` specifies a common well-known pattern
     // defined as a regex. If the field value doesn't match the well-known
@@ -2940,7 +3203,7 @@ message StringRules {
     // ```proto
     // message MyString {
     //   // value must be a valid HTTP header value
-    //   string value = 1 [(buf.validate.field).string.well_known_regex = 2];
+    //   string value = 1 [(buf.validate.field).string.well_known_regex = KNOWN_REGEX_HTTP_HEADER_VALUE];
     // }
     // ```
     //
@@ -2955,18 +3218,25 @@ message StringRules {
     // | KNOWN_REGEX_HTTP_HEADER_VALUE | 2      | HTTP header value as defined by [RFC 7230](https://tools.ietf.org/html/rfc7230#section-3.2.4) |
     KnownRegex well_known_regex = 24 [
       (priv.field).cel = {
-        id: "string.well_known_regex.header_name"
+        id: "string.well_known_regex.header_name",
+        message: "value must be a valid HTTP header name",
         expression:
-          "rules.well_known_regex == 1 && !this.matches(!has(rules.strict) || rules.strict ?"
+          "rules.well_known_regex != 1 || this == '' || this.matches(!has(rules.strict) || rules.strict ?"
           "'^:?[0-9a-zA-Z!#$%&\\'*+-.^_|~\\x60]+$' :"
-          "'^[^\\u0000\\u000A\\u000D]+$') ? 'value must be a valid HTTP header name' : ''",
+          "'^[^\\u0000\\u000A\\u000D]+$')",
+      },
+      (priv.field).cel = {
+        id: "string.well_known_regex.header_name_empty",
+        message: "value is empty, which is not a valid HTTP header name",
+        expression: "rules.well_known_regex != 1 || this != ''",
       },
       (priv.field).cel = {
         id: "string.well_known_regex.header_value",
+        message: "value must be a valid HTTP header value",
         expression:
-          "rules.well_known_regex == 2 && !this.matches(!has(rules.strict) || rules.strict ?"
+          "rules.well_known_regex != 2 || this.matches(!has(rules.strict) || rules.strict ?"
           "'^[^\\u0000-\\u0008\\u000A-\\u001F\\u007F]*$' :"
-          "'^[^\\u0000\\u000A\\u000D]*$') ? 'value must be a valid HTTP header value' : ''",
+          "'^[^\\u0000\\u000A\\u000D]*$')",
       }
     ];
   }
@@ -3163,10 +3433,18 @@ message BytesRules {
     //   optional bytes value = 1 [(buf.validate.field).bytes.ip = true];
     // }
     // ```
-    bool ip = 10 [(priv.field).cel = {
-      id: "bytes.ip",
-      expression: "this.size() != 4 && this.size() != 16 ? 'value must be a valid IP address' : ''"
-    }];
+    bool ip = 10 [
+      (priv.field).cel = {
+        id: "bytes.ip",
+        message: "value must be a valid IP address",
+        expression: "this.size() == 0 || this.size() == 4 || this.size() == 16",
+      },
+      (priv.field).cel = {
+        id: "bytes.ip_empty",
+        message: "value is empty, which is not a valid IP address",
+        expression: "this.size() != 0",
+      }
+    ];
 
     // `ipv4` ensures that the field `value` is a valid IPv4 address in byte format.
     // If the field value doesn't meet this constraint, an error message is generated.
@@ -3177,10 +3455,18 @@ message BytesRules {
     //   optional bytes value = 1 [(buf.validate.field).bytes.ipv4 = true];
     // }
     // ```
-    bool ipv4 = 11 [(priv.field).cel = {
-      id: "bytes.ipv4",
-      expression: "this.size() != 4 ? 'value must be a valid IPv4 address' : ''"
-    }];
+    bool ipv4 = 11 [
+      (priv.field).cel = {
+        id: "bytes.ipv4",
+        message: "value must be a valid IPv4 address",
+        expression: "this.size() == 0 || this.size() == 4",
+      },
+      (priv.field).cel = {
+        id: "bytes.ipv4_empty",
+        message: "value is empty, which is not a valid IPv4 address",
+        expression: "this.size() != 0",
+      }
+    ];
 
     // `ipv6` ensures that the field `value` is a valid IPv6 address in byte format.
     // If the field value doesn't meet this constraint, an error message is generated.
@@ -3190,10 +3476,18 @@ message BytesRules {
     //   optional bytes value = 1 [(buf.validate.field).bytes.ipv6 = true];
     // }
     // ```
-    bool ipv6 = 12 [(priv.field).cel = {
-      id: "bytes.ipv6",
-      expression: "this.size() != 16 ? 'value must be a valid IPv6 address' : ''"
-    }];
+    bool ipv6 = 12 [
+      (priv.field).cel = {
+        id: "bytes.ipv6",
+        message: "value must be a valid IPv6 address",
+        expression: "this.size() == 0 || this.size() == 16"
+      },
+      (priv.field).cel = {
+        id: "bytes.ipv6_empty",
+        message: "value is empty, which is not a valid IPv6 address",
+        expression: "this.size() != 0",
+      }
+    ];
   }
 }
 
@@ -3249,7 +3543,7 @@ message EnumRules {
   //
   // message MyMessage {
   //   // The field `value` must be equal to one of the specified values.
-  //   MyEnum value = 1 [(buf.validate.field).enum.in = {1, 2}];
+  //   MyEnum value = 1 [(buf.validate.field).enum = { in: [1, 2]}];
   // }
   // ```
   repeated int32 in = 3 [(priv.field).cel = {
@@ -3270,7 +3564,7 @@ message EnumRules {
   //
   // message MyMessage {
   //   // The field `value` must not be equal to any of the specified values.
-  //   MyEnum value = 1 [(buf.validate.field).enum.not_in = {1, 2}];
+  //   MyEnum value = 1 [(buf.validate.field).enum = { not_in: [1, 2]}];
   // }
   // ```
   repeated int32 not_in = 4 [(priv.field).cel = {
diff --git a/src/test/java/build/buf/protovalidate/internal/celext/CustomOverloadTest.java b/src/test/java/build/buf/protovalidate/internal/celext/CustomOverloadTest.java
index f75c701f..f80eef9a 100644
--- a/src/test/java/build/buf/protovalidate/internal/celext/CustomOverloadTest.java
+++ b/src/test/java/build/buf/protovalidate/internal/celext/CustomOverloadTest.java
@@ -179,6 +179,42 @@ public void testIsIpPrefixUnsupported() {
     }
   }
 
+  @Test
+  public void testIsHostname() {
+    Map testCases =
+        ImmutableMap.builder()
+            .put("'example.com'.isHostname()", true)
+            .put("'example.123'.isHostname()", false)
+            .build();
+    for (Map.Entry testCase : testCases.entrySet()) {
+      Program.EvalResult result = eval(testCase.getKey());
+      assertThat(result.getVal().booleanValue())
+          .as(
+              "expected %s=%s, got=%s",
+              testCase.getKey(), testCase.getValue(), !testCase.getValue())
+          .isEqualTo(testCase.getValue());
+    }
+  }
+
+  @Test
+  public void testIsEmail() {
+    Map testCases =
+        ImmutableMap.builder()
+            .put("'foo@example.com'.isEmail()", true)
+            .put("''.isEmail()", false)
+            .put("'  foo@example.com'.isEmail()", false)
+            .put("'foo@example.com    '.isEmail()", false)
+            .build();
+    for (Map.Entry testCase : testCases.entrySet()) {
+      Program.EvalResult result = eval(testCase.getKey());
+      assertThat(result.getVal().booleanValue())
+          .as(
+              "expected %s=%s, got=%s",
+              testCase.getKey(), testCase.getValue(), !testCase.getValue())
+          .isEqualTo(testCase.getValue());
+    }
+  }
+
   private Program.EvalResult eval(String source) {
     return eval(source, Activation.emptyActivation());
   }
diff --git a/src/test/resources/proto/buf.lock b/src/test/resources/proto/buf.lock
index 70a6948c..ea0feed2 100644
--- a/src/test/resources/proto/buf.lock
+++ b/src/test/resources/proto/buf.lock
@@ -4,5 +4,5 @@ deps:
   - remote: buf.build
     owner: bufbuild
     repository: protovalidate
-    commit: 12f9cba37c9d49eeb6827dde227d6031
-    digest: shake256:a9470135a1736bdb74396e35342b4431b0bf3a5e7a2198fb77f49be46af744aae134f8e0593683216e836f1f0a551ccf86a9f8857c6829b8d33f4b604602a5ff
+    commit: f05a6f4403ce4327bae4f50f281c3ed0
+    digest: shake256:668a0661b8df44d41839194896329330965fc215f3d2f88057fd60eeb759c2daf6cc6edfdd13b2a653d49fe2896ebedcb1a33c4c5b2dd10919f03ffb7fc52ae6
diff --git a/src/test/resources/proto/buf.yaml b/src/test/resources/proto/buf.yaml
index ba82961d..e7491b44 100644
--- a/src/test/resources/proto/buf.yaml
+++ b/src/test/resources/proto/buf.yaml
@@ -3,7 +3,7 @@ breaking:
   use:
     - FILE
 deps:
-  - buf.build/bufbuild/protovalidate:v0.5.1
+  - buf.build/bufbuild/protovalidate:v0.6.1
 lint:
   use:
     - DEFAULT