From 85f97a3aba8834f6acc824e33439683bf979bb0c Mon Sep 17 00:00:00 2001 From: Steve Ayers Date: Wed, 9 Apr 2025 11:11:54 -0400 Subject: [PATCH] Update to Protovalidate 0.10.4 --- conformance/expected-failures.yaml | 25 + .../RequiredEditionsMapIgnoreAlways.java | 644 ++++++++++ ...uiredEditionsMapIgnoreAlwaysOrBuilder.java | 45 + ...ExplicitPresenceDelimitedIgnoreAlways.java | 1097 ++++++++++++++++ ...resenceDelimitedIgnoreAlwaysOrBuilder.java | 26 + ...nsMessageExplicitPresenceIgnoreAlways.java | 1097 ++++++++++++++++ ...ExplicitPresenceIgnoreAlwaysOrBuilder.java | 26 + .../RequiredEditionsOneofIgnoreAlways.java | 786 ++++++++++++ ...redEditionsOneofIgnoreAlwaysOrBuilder.java | 47 + ...dEditionsRepeatedExpandedIgnoreAlways.java | 554 +++++++++ ...RepeatedExpandedIgnoreAlwaysOrBuilder.java | 36 + .../RequiredEditionsRepeatedIgnoreAlways.java | 554 +++++++++ ...EditionsRepeatedIgnoreAlwaysOrBuilder.java | 36 + ...arExplicitPresenceDefaultIgnoreAlways.java | 525 ++++++++ ...tPresenceDefaultIgnoreAlwaysOrBuilder.java | 28 + ...onsScalarExplicitPresenceIgnoreAlways.java | 525 ++++++++ ...ExplicitPresenceIgnoreAlwaysOrBuilder.java | 28 + ...onsScalarImplicitPresenceIgnoreAlways.java | 501 ++++++++ ...ImplicitPresenceIgnoreAlwaysOrBuilder.java | 23 + .../cases/RequiredFieldProto2Proto.java | 157 ++- .../cases/RequiredFieldProto3Proto.java | 152 ++- .../RequiredFieldProtoEditionsProto.java | 260 +++- .../cases/RequiredProto2MapIgnoreAlways.java | 644 ++++++++++ ...equiredProto2MapIgnoreAlwaysOrBuilder.java | 45 + .../RequiredProto2MessageIgnoreAlways.java | 1100 +++++++++++++++++ ...redProto2MessageIgnoreAlwaysOrBuilder.java | 26 + .../RequiredProto2OneofIgnoreAlways.java | 788 ++++++++++++ ...uiredProto2OneofIgnoreAlwaysOrBuilder.java | 47 + .../RequiredProto2RepeatedIgnoreAlways.java | 553 +++++++++ ...edProto2RepeatedIgnoreAlwaysOrBuilder.java | 36 + ...oto2ScalarOptionalDefaultIgnoreAlways.java | 528 ++++++++ ...rOptionalDefaultIgnoreAlwaysOrBuilder.java | 28 + ...uiredProto2ScalarOptionalIgnoreAlways.java | 528 ++++++++ ...o2ScalarOptionalIgnoreAlwaysOrBuilder.java | 28 + .../cases/RequiredProto3MapIgnoreAlways.java | 644 ++++++++++ ...equiredProto3MapIgnoreAlwaysOrBuilder.java | 45 + .../RequiredProto3MessageIgnoreAlways.java | 1068 ++++++++++++++++ ...redProto3MessageIgnoreAlwaysOrBuilder.java | 26 + .../RequiredProto3OneOfIgnoreAlways.java | 786 ++++++++++++ ...uiredProto3OneOfIgnoreAlwaysOrBuilder.java | 47 + ...uiredProto3OptionalScalarIgnoreAlways.java | 525 ++++++++ ...o3OptionalScalarIgnoreAlwaysOrBuilder.java | 28 + .../RequiredProto3RepeatedIgnoreAlways.java | 554 +++++++++ ...edProto3RepeatedIgnoreAlwaysOrBuilder.java | 36 + .../RequiredProto3ScalarIgnoreAlways.java | 501 ++++++++ ...iredProto3ScalarIgnoreAlwaysOrBuilder.java | 23 + gradle.properties | 2 +- 47 files changed, 15707 insertions(+), 101 deletions(-) create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMapIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMapIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsOneofIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsOneofIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedExpandedIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedExpandedIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarImplicitPresenceIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarImplicitPresenceIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MapIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MapIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MessageIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MessageIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2OneofIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2OneofIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2RepeatedIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2RepeatedIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalDefaultIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalDefaultIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MapIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MapIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MessageIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MessageIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OneOfIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OneOfIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OptionalScalarIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OptionalScalarIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3RepeatedIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3RepeatedIgnoreAlwaysOrBuilder.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3ScalarIgnoreAlways.java create mode 100644 conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3ScalarIgnoreAlwaysOrBuilder.java diff --git a/conformance/expected-failures.yaml b/conformance/expected-failures.yaml index be9c0ac3..930628b6 100644 --- a/conformance/expected-failures.yaml +++ b/conformance/expected-failures.yaml @@ -1020,3 +1020,28 @@ standard_constraints/ignore: # message: "value must be greater than 0" # field: "val" elements:{field_number:1 field_name:"val" field_type:TYPE_INT32} # rule: "int32.gt" elements:{field_number:3 field_name:"int32" field_type:TYPE_MESSAGE} elements:{field_number:4 field_name:"gt" field_type:TYPE_INT32} +standard_constraints/required: + - proto/2023/message/explicit_presence/delimited/unset/ignore_always + - proto2/scalar/optional/unset/ignore_always + - proto3/scalar/optional/unset/ignore_always + - proto/2023/map/empty/ignore_always + - proto/2023/scalar/explicit_presence_with_default/unset/ignore_always + - proto2/oneof/other_member/ignore_always + - proto2/oneof/unset/ignore_always + - proto3/oneof/other_member/ignore_always + - proto/2023/repeated/expanded/empty/ignore_always + - proto/2023/oneof/unset/ignore_always + - proto/2023/message/explicit_presence/length_prefixed/unset/ignore_always + - proto/2023/scalar/explicit_presence/unset/ignore_always + - proto2/message/unset/ignore_always + - proto3/repeated/empty/ignore_always + - proto3/map/empty/ignore_always + - proto3/scalar/zero/ignore_always + - proto3/oneof/unset/ignore_always + - proto/2023/repeated/compact/empty/ignore_always + - proto2/repeated/empty/ignore_always + - proto/2023/scalar/implicit_presence/zero/ignore_always + - proto2/scalar/optional_with_default/unset/ignore_always + - proto2/map/empty/ignore_always + - proto3/message/unset/ignore_always + - proto/2023/oneof/other_member/ignore_always diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMapIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMapIgnoreAlways.java new file mode 100644 index 00000000..144f1bd8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMapIgnoreAlways.java @@ -0,0 +1,644 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways} + */ +public final class RequiredEditionsMapIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways) + RequiredEditionsMapIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredEditionsMapIgnoreAlways.class.getName()); + } + // Use RequiredEditionsMapIgnoreAlways.newBuilder() to construct. + private RequiredEditionsMapIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredEditionsMapIgnoreAlways() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMapIgnoreAlways_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMapIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMapIgnoreAlways_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> 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<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public /* nullable */ +java.lang.String getValOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.lang.String getValOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map 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.GeneratedMessage + .serializeStringMapTo( + 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.RequiredEditionsMapIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways) 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.RequiredEditionsMapIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways 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.RequiredEditionsMapIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways 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.RequiredEditionsMapIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways 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.RequiredEditionsMapIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredEditionsMapIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways) + build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMapIgnoreAlways_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMapIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMapIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways.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.String, java.lang.String> 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<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public /* nullable */ +java.lang.String getValOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.lang.String getValOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map 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<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map 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<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredEditionsMapIgnoreAlways 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.RequiredEditionsMapIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMapIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMapIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..1babcce8 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMapIgnoreAlwaysOrBuilder.java @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredEditionsMapIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredEditionsMapIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + java.lang.String key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + /* nullable */ +java.lang.String getValOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.lang.String getValOrThrow( + java.lang.String key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.java new file mode 100644 index 00000000..9b64da75 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.java @@ -0,0 +1,1097 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways} + */ +public final class RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways) + RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.class.getName()); + } + // Use RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.newBuilder() to construct. + private RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + Msg.class.getName()); + } + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.class, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * 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; + } + } + /** + * 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.GeneratedMessage.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.GeneratedMessage.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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg other = (build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg) + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.class, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg build() { + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg buildPartial() { + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg result = new build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg other) { + if (other == build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.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_ = ""; + /** + * string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * 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; + } + } + /** + * 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; + } + } + /** + * 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; + } + /** + * string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * 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; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg) + private static final build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg(); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val_; + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.getDefaultInstance() : val_; + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.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.writeGroup(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 + .computeGroupSize(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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways) 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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways 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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways 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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways 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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways) + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetValFieldBuilder(); + } + } + @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.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways 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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.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 11: { + input.readGroup(1, + internalGetValFieldBuilder().getBuilder(), + extensionRegistry); + bitField0_ |= 0x00000001; + break; + } // case 11 + 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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val_; + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.Builder, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.MsgOrBuilder> valBuilder_; + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + */ + public Builder clearVal() { + bitField0_ = (bitField0_ & ~0x00000001); + val_ = null; + if (valBuilder_ != null) { + valBuilder_.dispose(); + valBuilder_ = null; + } + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + */ + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetValFieldBuilder().getBuilder(); + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + */ + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.getDefaultInstance() : val_; + } + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.Builder, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.MsgOrBuilder> + internalGetValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg.Builder, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways 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.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..b5f3bb42 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlwaysOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg getVal(); + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.Msg val = 1 [json_name = "val", features = { ... } + */ + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceIgnoreAlways.java new file mode 100644 index 00000000..39bceff1 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceIgnoreAlways.java @@ -0,0 +1,1097 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways} + */ +public final class RequiredEditionsMessageExplicitPresenceIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways) + RequiredEditionsMessageExplicitPresenceIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredEditionsMessageExplicitPresenceIgnoreAlways.class.getName()); + } + // Use RequiredEditionsMessageExplicitPresenceIgnoreAlways.newBuilder() to construct. + private RequiredEditionsMessageExplicitPresenceIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredEditionsMessageExplicitPresenceIgnoreAlways() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + Msg.class.getName()); + } + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.class, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * 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; + } + } + /** + * 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.GeneratedMessage.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.GeneratedMessage.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.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg other = (build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg) + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.class, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg build() { + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg buildPartial() { + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg result = new build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg other) { + if (other == build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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_ = ""; + /** + * string val = 1 [json_name = "val"]; + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * 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; + } + } + /** + * 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; + } + } + /** + * 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; + } + /** + * string val = 1 [json_name = "val"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * 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; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg) + private static final build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg(); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val_; + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.getDefaultInstance() : val_; + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways) 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.RequiredEditionsMessageExplicitPresenceIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways 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.RequiredEditionsMessageExplicitPresenceIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways 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.RequiredEditionsMessageExplicitPresenceIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways 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.RequiredEditionsMessageExplicitPresenceIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredEditionsMessageExplicitPresenceIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways) + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetValFieldBuilder(); + } + } + @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.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways 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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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( + internalGetValFieldBuilder().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.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val_; + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.Builder, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.MsgOrBuilder> valBuilder_; + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.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.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetValFieldBuilder().getBuilder(); + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.getDefaultInstance() : val_; + } + } + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.Builder, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.MsgOrBuilder> + internalGetValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg.Builder, build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredEditionsMessageExplicitPresenceIgnoreAlways 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.RequiredEditionsMessageExplicitPresenceIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..89169a52 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsMessageExplicitPresenceIgnoreAlwaysOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredEditionsMessageExplicitPresenceIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg getVal(); + /** + * .buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.RequiredEditionsMessageExplicitPresenceIgnoreAlways.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsOneofIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsOneofIgnoreAlways.java new file mode 100644 index 00000000..05e8a315 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsOneofIgnoreAlways.java @@ -0,0 +1,786 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways} + */ +public final class RequiredEditionsOneofIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways) + RequiredEditionsOneofIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredEditionsOneofIgnoreAlways.class.getName()); + } + // Use RequiredEditionsOneofIgnoreAlways.newBuilder() to construct. + private RequiredEditionsOneofIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredEditionsOneofIgnoreAlways() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsOneofIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsOneofIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways.Builder.class); + } + + private int valCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object val_; + public enum ValCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + A(1), + B(2), + VAL_NOT_SET(0); + private final int value; + private ValCase(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 ValCase valueOf(int value) { + return forNumber(value); + } + + public static ValCase forNumber(int value) { + switch (value) { + case 1: return A; + case 2: return B; + case 0: return VAL_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ValCase + getValCase() { + return ValCase.forNumber( + valCase_); + } + + public static final int A_FIELD_NUMBER = 1; + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + public boolean hasA() { + return valCase_ == 1; + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + public java.lang.String getA() { + java.lang.Object ref = ""; + if (valCase_ == 1) { + 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 (valCase_ == 1) { + val_ = s; + } + return s; + } + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The bytes for a. + */ + public com.google.protobuf.ByteString + getABytes() { + java.lang.Object ref = ""; + if (valCase_ == 1) { + ref = val_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valCase_ == 1) { + val_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int B_FIELD_NUMBER = 2; + /** + * string b = 2 [json_name = "b"]; + * @return Whether the b field is set. + */ + public boolean hasB() { + return valCase_ == 2; + } + /** + * string b = 2 [json_name = "b"]; + * @return The b. + */ + public java.lang.String getB() { + java.lang.Object ref = ""; + if (valCase_ == 2) { + 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 (valCase_ == 2) { + val_ = s; + } + return s; + } + } + /** + * string b = 2 [json_name = "b"]; + * @return The bytes for b. + */ + public com.google.protobuf.ByteString + getBBytes() { + java.lang.Object ref = ""; + if (valCase_ == 2) { + ref = val_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valCase_ == 2) { + 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 (valCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, val_); + } + if (valCase_ == 2) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, val_); + } + if (valCase_ == 2) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, 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.RequiredEditionsOneofIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways) obj; + + if (!getValCase().equals(other.getValCase())) return false; + switch (valCase_) { + case 1: + if (!getA() + .equals(other.getA())) return false; + break; + case 2: + if (!getB() + .equals(other.getB())) 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 (valCase_) { + case 1: + hash = (37 * hash) + A_FIELD_NUMBER; + hash = (53 * hash) + getA().hashCode(); + break; + case 2: + hash = (37 * hash) + B_FIELD_NUMBER; + hash = (53 * hash) + getB().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways 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.RequiredEditionsOneofIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways 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.RequiredEditionsOneofIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways 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.RequiredEditionsOneofIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredEditionsOneofIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways) + build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsOneofIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsOneofIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + valCase_ = 0; + val_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsOneofIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways result) { + result.valCase_ = valCase_; + result.val_ = this.val_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways.getDefaultInstance()) return this; + switch (other.getValCase()) { + case A: { + valCase_ = 1; + val_ = other.val_; + onChanged(); + break; + } + case B: { + valCase_ = 2; + val_ = other.val_; + onChanged(); + break; + } + case VAL_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 10: { + java.lang.String s = input.readStringRequireUtf8(); + valCase_ = 1; + val_ = s; + break; + } // case 10 + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + valCase_ = 2; + val_ = s; + break; + } // case 18 + 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 valCase_ = 0; + private java.lang.Object val_; + public ValCase + getValCase() { + return ValCase.forNumber( + valCase_); + } + + public Builder clearVal() { + valCase_ = 0; + val_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + @java.lang.Override + public boolean hasA() { + return valCase_ == 1; + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public java.lang.String getA() { + java.lang.Object ref = ""; + if (valCase_ == 1) { + 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 (valCase_ == 1) { + val_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The bytes for a. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getABytes() { + java.lang.Object ref = ""; + if (valCase_ == 1) { + ref = val_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valCase_ == 1) { + val_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @param value The a to set. + * @return This builder for chaining. + */ + public Builder setA( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + valCase_ = 1; + val_ = value; + onChanged(); + return this; + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearA() { + if (valCase_ == 1) { + valCase_ = 0; + val_ = null; + onChanged(); + } + return this; + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @param value The bytes for a to set. + * @return This builder for chaining. + */ + public Builder setABytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + valCase_ = 1; + val_ = value; + onChanged(); + return this; + } + + /** + * string b = 2 [json_name = "b"]; + * @return Whether the b field is set. + */ + @java.lang.Override + public boolean hasB() { + return valCase_ == 2; + } + /** + * string b = 2 [json_name = "b"]; + * @return The b. + */ + @java.lang.Override + public java.lang.String getB() { + java.lang.Object ref = ""; + if (valCase_ == 2) { + 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 (valCase_ == 2) { + val_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string b = 2 [json_name = "b"]; + * @return The bytes for b. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBBytes() { + java.lang.Object ref = ""; + if (valCase_ == 2) { + ref = val_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valCase_ == 2) { + val_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string b = 2 [json_name = "b"]; + * @param value The b to set. + * @return This builder for chaining. + */ + public Builder setB( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + valCase_ = 2; + val_ = value; + onChanged(); + return this; + } + /** + * string b = 2 [json_name = "b"]; + * @return This builder for chaining. + */ + public Builder clearB() { + if (valCase_ == 2) { + valCase_ = 0; + val_ = null; + onChanged(); + } + return this; + } + /** + * string b = 2 [json_name = "b"]; + * @param value The bytes for b to set. + * @return This builder for chaining. + */ + public Builder setBBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + valCase_ = 2; + val_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredEditionsOneofIgnoreAlways 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.RequiredEditionsOneofIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsOneofIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsOneofIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..c75a10db --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsOneofIgnoreAlwaysOrBuilder.java @@ -0,0 +1,47 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredEditionsOneofIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + boolean hasA(); + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + java.lang.String getA(); + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The bytes for a. + */ + com.google.protobuf.ByteString + getABytes(); + + /** + * string b = 2 [json_name = "b"]; + * @return Whether the b field is set. + */ + boolean hasB(); + /** + * string b = 2 [json_name = "b"]; + * @return The b. + */ + java.lang.String getB(); + /** + * string b = 2 [json_name = "b"]; + * @return The bytes for b. + */ + com.google.protobuf.ByteString + getBBytes(); + + build.buf.validate.conformance.cases.RequiredEditionsOneofIgnoreAlways.ValCase getValCase(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedExpandedIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedExpandedIgnoreAlways.java new file mode 100644 index 00000000..083d1155 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedExpandedIgnoreAlways.java @@ -0,0 +1,554 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways} + */ +public final class RequiredEditionsRepeatedExpandedIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways) + RequiredEditionsRepeatedExpandedIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredEditionsRepeatedExpandedIgnoreAlways.class.getName()); + } + // Use RequiredEditionsRepeatedExpandedIgnoreAlways.newBuilder() to construct. + private RequiredEditionsRepeatedExpandedIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredEditionsRepeatedExpandedIgnoreAlways() { + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedExpandedIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedExpandedIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @return A list containing the val. + */ + public com.google.protobuf.ProtocolStringList + getValList() { + return val_; + } + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public java.lang.String getVal(int index) { + return val_.get(index); + } + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @param index The index of the value to return. + * @return The bytes of the val at the given index. + */ + public com.google.protobuf.ByteString + getValBytes(int index) { + return val_.getByteString(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++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, val_.getRaw(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 += computeStringSizeNoTag(val_.getRaw(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.RequiredEditionsRepeatedExpandedIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways) 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.RequiredEditionsRepeatedExpandedIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways 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.RequiredEditionsRepeatedExpandedIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways 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.RequiredEditionsRepeatedExpandedIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways 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.RequiredEditionsRepeatedExpandedIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredEditionsRepeatedExpandedIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways) + build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedExpandedIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedExpandedIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedExpandedIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + 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 10: { + java.lang.String s = input.readStringRequireUtf8(); + ensureValIsMutable(); + val_.add(s); + 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.LazyStringArrayList val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = new com.google.protobuf.LazyStringArrayList(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @return A list containing the val. + */ + public com.google.protobuf.ProtocolStringList + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + public java.lang.String getVal(int index) { + return val_.get(index); + } + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @param index The index of the value to return. + * @return The bytes of the val at the given index. + */ + public com.google.protobuf.ByteString + getValBytes(int index) { + return val_.getByteString(index); + } + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @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, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureValIsMutable(); + val_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureValIsMutable(); + val_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @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 string val = 1 [json_name = "val", features = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @param value The bytes of the val to add. + * @return This builder for chaining. + */ + public Builder addValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureValIsMutable(); + val_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredEditionsRepeatedExpandedIgnoreAlways 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.RequiredEditionsRepeatedExpandedIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedExpandedIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedExpandedIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..4e7d8c4d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedExpandedIgnoreAlwaysOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredEditionsRepeatedExpandedIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredEditionsRepeatedExpandedIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @return A list containing the val. + */ + java.util.List + getValList(); + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + java.lang.String getVal(int index); + /** + * repeated string val = 1 [json_name = "val", features = { ... } + * @param index The index of the value to return. + * @return The bytes of the val at the given index. + */ + com.google.protobuf.ByteString + getValBytes(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedIgnoreAlways.java new file mode 100644 index 00000000..d5648791 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedIgnoreAlways.java @@ -0,0 +1,554 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways} + */ +public final class RequiredEditionsRepeatedIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways) + RequiredEditionsRepeatedIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredEditionsRepeatedIgnoreAlways.class.getName()); + } + // Use RequiredEditionsRepeatedIgnoreAlways.newBuilder() to construct. + private RequiredEditionsRepeatedIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredEditionsRepeatedIgnoreAlways() { + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public com.google.protobuf.ProtocolStringList + getValList() { + return val_; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated string 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 java.lang.String getVal(int index) { + return val_.get(index); + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the value to return. + * @return The bytes of the val at the given index. + */ + public com.google.protobuf.ByteString + getValBytes(int index) { + return val_.getByteString(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++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, val_.getRaw(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 += computeStringSizeNoTag(val_.getRaw(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.RequiredEditionsRepeatedIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways) 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.RequiredEditionsRepeatedIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways 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.RequiredEditionsRepeatedIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways 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.RequiredEditionsRepeatedIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways 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.RequiredEditionsRepeatedIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredEditionsRepeatedIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways) + build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + 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 10: { + java.lang.String s = input.readStringRequireUtf8(); + ensureValIsMutable(); + val_.add(s); + 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.LazyStringArrayList val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = new com.google.protobuf.LazyStringArrayList(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public com.google.protobuf.ProtocolStringList + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated string 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 java.lang.String getVal(int index) { + return val_.get(index); + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the value to return. + * @return The bytes of the val at the given index. + */ + public com.google.protobuf.ByteString + getValBytes(int index) { + return val_.getByteString(index); + } + /** + * repeated string 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, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureValIsMutable(); + val_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureValIsMutable(); + val_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string 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 string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The bytes of the val to add. + * @return This builder for chaining. + */ + public Builder addValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureValIsMutable(); + val_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredEditionsRepeatedIgnoreAlways 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.RequiredEditionsRepeatedIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..6f51542d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsRepeatedIgnoreAlwaysOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredEditionsRepeatedIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredEditionsRepeatedIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List + getValList(); + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + java.lang.String getVal(int index); + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the value to return. + * @return The bytes of the val at the given index. + */ + com.google.protobuf.ByteString + getValBytes(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.java new file mode 100644 index 00000000..6af0a205 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.java @@ -0,0 +1,525 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways} + */ +public final class RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways) + RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.class.getName()); + } + // Use RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.newBuilder() to construct. + private RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways() { + val_ = "foo"; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = "foo"; + /** + * string val = 1 [default = "foo", json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * string val = 1 [default = "foo", 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 [default = "foo", 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 (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways) 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.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways 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.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways 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.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways 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.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways) + build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = "foo"; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways 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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways.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_ = "foo"; + /** + * string val = 1 [default = "foo", json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * string val = 1 [default = "foo", 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 [default = "foo", 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 [default = "foo", 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 [default = "foo", 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 [default = "foo", 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; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways 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.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..c83d1dc3 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlwaysOrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [default = "foo", json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * string val = 1 [default = "foo", json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [default = "foo", 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/RequiredEditionsScalarExplicitPresenceIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceIgnoreAlways.java new file mode 100644 index 00000000..6e0b3c7a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceIgnoreAlways.java @@ -0,0 +1,525 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways} + */ +public final class RequiredEditionsScalarExplicitPresenceIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways) + RequiredEditionsScalarExplicitPresenceIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredEditionsScalarExplicitPresenceIgnoreAlways.class.getName()); + } + // Use RequiredEditionsScalarExplicitPresenceIgnoreAlways.newBuilder() to construct. + private RequiredEditionsScalarExplicitPresenceIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredEditionsScalarExplicitPresenceIgnoreAlways() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways.Builder.class); + } + + private int bitField0_; + 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 Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * 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 (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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.RequiredEditionsScalarExplicitPresenceIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways) 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.RequiredEditionsScalarExplicitPresenceIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways 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.RequiredEditionsScalarExplicitPresenceIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways 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.RequiredEditionsScalarExplicitPresenceIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways 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.RequiredEditionsScalarExplicitPresenceIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredEditionsScalarExplicitPresenceIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways) + build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways 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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways.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_ = ""; + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * 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; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredEditionsScalarExplicitPresenceIgnoreAlways 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.RequiredEditionsScalarExplicitPresenceIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..b3fabdd7 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarExplicitPresenceIgnoreAlwaysOrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredEditionsScalarExplicitPresenceIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredEditionsScalarExplicitPresenceIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * 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/RequiredEditionsScalarImplicitPresenceIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarImplicitPresenceIgnoreAlways.java new file mode 100644 index 00000000..0db5a907 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarImplicitPresenceIgnoreAlways.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways} + */ +public final class RequiredEditionsScalarImplicitPresenceIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways) + RequiredEditionsScalarImplicitPresenceIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredEditionsScalarImplicitPresenceIgnoreAlways.class.getName()); + } + // Use RequiredEditionsScalarImplicitPresenceIgnoreAlways.newBuilder() to construct. + private RequiredEditionsScalarImplicitPresenceIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredEditionsScalarImplicitPresenceIgnoreAlways() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarImplicitPresenceIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarImplicitPresenceIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * string val = 1 [json_name = "val", features = { ... } + * @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", features = { ... } + * @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.GeneratedMessage.isStringEmpty(val_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(val_)) { + size += com.google.protobuf.GeneratedMessage.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.RequiredEditionsScalarImplicitPresenceIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways) 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.RequiredEditionsScalarImplicitPresenceIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways 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.RequiredEditionsScalarImplicitPresenceIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways 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.RequiredEditionsScalarImplicitPresenceIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways 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.RequiredEditionsScalarImplicitPresenceIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredEditionsScalarImplicitPresenceIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways) + build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarImplicitPresenceIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarImplicitPresenceIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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.RequiredFieldProtoEditionsProto.internal_static_buf_validate_conformance_cases_RequiredEditionsScalarImplicitPresenceIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways.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", features = { ... } + * @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", features = { ... } + * @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", features = { ... } + * @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", features = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * string val = 1 [json_name = "val", features = { ... } + * @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; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredEditionsScalarImplicitPresenceIgnoreAlways 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.RequiredEditionsScalarImplicitPresenceIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarImplicitPresenceIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarImplicitPresenceIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..09a39f4f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredEditionsScalarImplicitPresenceIgnoreAlwaysOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto_editions.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredEditionsScalarImplicitPresenceIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredEditionsScalarImplicitPresenceIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val", features = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val", features = { ... } + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredFieldProto2Proto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredFieldProto2Proto.java index c27fe045..1b815e3e 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredFieldProto2Proto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredFieldProto2Proto.java @@ -30,11 +30,21 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptional_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefault_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefaultIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefaultIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredProto2ScalarRequired_descriptor; static final @@ -50,16 +60,36 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredProto2Message_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_Msg_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredProto2Oneof_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredProto2Oneof_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto2OneofIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto2OneofIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredProto2Repeated_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredProto2Repeated_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto2RepeatedIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto2RepeatedIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredProto2Map_descriptor; static final @@ -70,6 +100,16 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredProto2Map_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_ValEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -82,27 +122,44 @@ public static void registerAllExtensions( "\n:buf/validate/conformance/cases/require" + "d_field_proto2.proto\022\036buf.validate.confo" + "rmance.cases\032\033buf/validate/validate.prot" + - "o\";\n\034RequiredProto2ScalarOptional\022\033\n\003val" + - "\030\001 \001(\tB\t\272H\006\310\001\001\330\001\003R\003val\"G\n#RequiredProto2" + - "ScalarOptionalDefault\022 \n\003val\030\001 \001(\t:\003fooB" + - "\t\272H\006\310\001\001\330\001\003R\003val\"8\n\034RequiredProto2ScalarR" + - "equired\022\030\n\003val\030\001 \002(\tB\006\272H\003\310\001\001R\003val\"\205\001\n\025Re" + - "quiredProto2Message\022S\n\003val\030\001 \001(\01329.buf.v" + - "alidate.conformance.cases.RequiredProto2" + - "Message.MsgB\006\272H\003\310\001\001R\003val\032\027\n\003Msg\022\020\n\003val\030\001" + - " \001(\tR\003val\"D\n\023RequiredProto2Oneof\022\026\n\001a\030\001 " + - "\001(\tB\006\272H\003\310\001\001H\000R\001a\022\016\n\001b\030\002 \001(\tH\000R\001bB\005\n\003val\"" + + "o\"8\n\034RequiredProto2ScalarOptional\022\030\n\003val" + + "\030\001 \001(\tB\006\272H\003\310\001\001R\003val\"G\n(RequiredProto2Sca" + + "larOptionalIgnoreAlways\022\033\n\003val\030\001 \001(\tB\t\272H" + + "\006\310\001\001\330\001\003R\003val\"D\n#RequiredProto2ScalarOpti" + + "onalDefault\022\035\n\003val\030\001 \001(\t:\003fooB\006\272H\003\310\001\001R\003v" + + "al\"S\n/RequiredProto2ScalarOptionalDefaul" + + "tIgnoreAlways\022 \n\003val\030\001 \001(\t:\003fooB\t\272H\006\310\001\001\330" + + "\001\003R\003val\"8\n\034RequiredProto2ScalarRequired\022" + + "\030\n\003val\030\001 \002(\tB\006\272H\003\310\001\001R\003val\"\205\001\n\025RequiredPr" + + "oto2Message\022S\n\003val\030\001 \001(\01329.buf.validate." + + "conformance.cases.RequiredProto2Message." + + "MsgB\006\272H\003\310\001\001R\003val\032\027\n\003Msg\022\020\n\003val\030\001 \001(\tR\003va" + + "l\"\240\001\n!RequiredProto2MessageIgnoreAlways\022" + + "b\n\003val\030\001 \001(\0132E.buf.validate.conformance." + + "cases.RequiredProto2MessageIgnoreAlways." + + "MsgB\t\272H\006\310\001\001\330\001\003R\003val\032\027\n\003Msg\022\020\n\003val\030\001 \001(\tR" + + "\003val\"D\n\023RequiredProto2Oneof\022\026\n\001a\030\001 \001(\tB\006" + + "\272H\003\310\001\001H\000R\001a\022\016\n\001b\030\002 \001(\tH\000R\001bB\005\n\003val\"S\n\037Re" + + "quiredProto2OneofIgnoreAlways\022\031\n\001a\030\001 \001(\t" + + "B\t\272H\006\310\001\001\330\001\003H\000R\001a\022\016\n\001b\030\002 \001(\tH\000R\001bB\005\n\003val\"" + "2\n\026RequiredProto2Repeated\022\030\n\003val\030\001 \003(\tB\006" + - "\272H\003\310\001\001R\003val\"\241\001\n\021RequiredProto2Map\022T\n\003val" + - "\030\001 \003(\0132:.buf.validate.conformance.cases." + - "RequiredProto2Map.ValEntryB\006\272H\003\310\001\001R\003val\032" + - "6\n\010ValEntry\022\020\n\003key\030\001 \001(\tR\003key\022\024\n\005value\030\002" + - " \001(\tR\005value:\0028\001B\334\001\n$build.buf.validate.c" + - "onformance.casesB\030RequiredFieldProto2Pro" + - "toP\001\242\002\004BVCC\252\002\036Buf.Validate.Conformance.C" + - "ases\312\002\036Buf\\Validate\\Conformance\\Cases\342\002*" + - "Buf\\Validate\\Conformance\\Cases\\GPBMetada" + - "ta\352\002!Buf::Validate::Conformance::Cases" + "\272H\003\310\001\001R\003val\"A\n\"RequiredProto2RepeatedIgn" + + "oreAlways\022\033\n\003val\030\001 \003(\tB\t\272H\006\310\001\001\330\001\003R\003val\"\241" + + "\001\n\021RequiredProto2Map\022T\n\003val\030\001 \003(\0132:.buf." + + "validate.conformance.cases.RequiredProto" + + "2Map.ValEntryB\006\272H\003\310\001\001R\003val\0326\n\010ValEntry\022\020" + + "\n\003key\030\001 \001(\tR\003key\022\024\n\005value\030\002 \001(\tR\005value:\002" + + "8\001\"\274\001\n\035RequiredProto2MapIgnoreAlways\022c\n\003" + + "val\030\001 \003(\0132F.buf.validate.conformance.cas" + + "es.RequiredProto2MapIgnoreAlways.ValEntr" + + "yB\t\272H\006\310\001\001\330\001\003R\003val\0326\n\010ValEntry\022\020\n\003key\030\001 \001" + + "(\tR\003key\022\024\n\005value\030\002 \001(\tR\005value:\0028\001B\334\001\n$bu" + + "ild.buf.validate.conformance.casesB\030Requ" + + "iredFieldProto2ProtoP\001\242\002\004BVCC\252\002\036Buf.Vali" + + "date.Conformance.Cases\312\002\036Buf\\Validate\\Co" + + "nformance\\Cases\342\002*Buf\\Validate\\Conforman" + + "ce\\Cases\\GPBMetadata\352\002!Buf::Validate::Co" + + "nformance::Cases" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -115,20 +172,32 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptional_descriptor, new java.lang.String[] { "Val", }); - internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefault_descriptor = + internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalIgnoreAlways_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalIgnoreAlways_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalIgnoreAlways_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefault_descriptor = + getDescriptor().getMessageTypes().get(2); internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefault_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefault_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefaultIgnoreAlways_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefaultIgnoreAlways_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefaultIgnoreAlways_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RequiredProto2ScalarRequired_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(4); internal_static_buf_validate_conformance_cases_RequiredProto2ScalarRequired_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto2ScalarRequired_descriptor, new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RequiredProto2Message_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(5); internal_static_buf_validate_conformance_cases_RequiredProto2Message_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto2Message_descriptor, @@ -139,20 +208,44 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto2Message_Msg_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_descriptor = + getDescriptor().getMessageTypes().get(6); + internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_Msg_descriptor = + internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_Msg_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RequiredProto2Oneof_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(7); internal_static_buf_validate_conformance_cases_RequiredProto2Oneof_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto2Oneof_descriptor, new java.lang.String[] { "A", "B", "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto2OneofIgnoreAlways_descriptor = + getDescriptor().getMessageTypes().get(8); + internal_static_buf_validate_conformance_cases_RequiredProto2OneofIgnoreAlways_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto2OneofIgnoreAlways_descriptor, + new java.lang.String[] { "A", "B", "Val", }); internal_static_buf_validate_conformance_cases_RequiredProto2Repeated_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(9); internal_static_buf_validate_conformance_cases_RequiredProto2Repeated_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto2Repeated_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto2RepeatedIgnoreAlways_descriptor = + getDescriptor().getMessageTypes().get(10); + internal_static_buf_validate_conformance_cases_RequiredProto2RepeatedIgnoreAlways_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto2RepeatedIgnoreAlways_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RequiredProto2Map_descriptor = - getDescriptor().getMessageTypes().get(6); + getDescriptor().getMessageTypes().get(11); internal_static_buf_validate_conformance_cases_RequiredProto2Map_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto2Map_descriptor, @@ -163,6 +256,18 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto2Map_ValEntry_descriptor, new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_descriptor = + getDescriptor().getMessageTypes().get(12); + internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); descriptor.resolveAllFeaturesImmutable(); build.buf.validate.ValidateProto.getDescriptor(); com.google.protobuf.ExtensionRegistry registry = diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredFieldProto3Proto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredFieldProto3Proto.java index 6b7e0fe2..bb5d9cb8 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredFieldProto3Proto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredFieldProto3Proto.java @@ -30,11 +30,21 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredProto3Scalar_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto3ScalarIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto3ScalarIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalar_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalar_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalarIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalarIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredProto3Message_descriptor; static final @@ -45,16 +55,36 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredProto3Message_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_Msg_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredProto3OneOf_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredProto3OneOf_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto3OneOfIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto3OneOfIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredProto3Repeated_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredProto3Repeated_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto3RepeatedIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto3RepeatedIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredProto3Map_descriptor; static final @@ -65,6 +95,16 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredProto3Map_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_ValEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -78,25 +118,41 @@ public static void registerAllExtensions( "d_field_proto3.proto\022\036buf.validate.confo" + "rmance.cases\032\033buf/validate/validate.prot" + "o\"0\n\024RequiredProto3Scalar\022\030\n\003val\030\001 \001(\tB\006" + - "\272H\003\310\001\001R\003val\"E\n\034RequiredProto3OptionalSca" + - "lar\022\035\n\003val\030\001 \001(\tB\006\272H\003\310\001\001H\000R\003val\210\001\001B\006\n\004_v" + - "al\"\205\001\n\025RequiredProto3Message\022S\n\003val\030\001 \001(" + - "\01329.buf.validate.conformance.cases.Requi" + - "redProto3Message.MsgB\006\272H\003\310\001\001R\003val\032\027\n\003Msg" + - "\022\020\n\003val\030\001 \001(\tR\003val\"D\n\023RequiredProto3OneO" + - "f\022\026\n\001a\030\001 \001(\tB\006\272H\003\310\001\001H\000R\001a\022\016\n\001b\030\002 \001(\tH\000R\001" + - "bB\005\n\003val\"2\n\026RequiredProto3Repeated\022\030\n\003va" + - "l\030\001 \003(\tB\006\272H\003\310\001\001R\003val\"\241\001\n\021RequiredProto3M" + - "ap\022T\n\003val\030\001 \003(\0132:.buf.validate.conforman" + - "ce.cases.RequiredProto3Map.ValEntryB\006\272H\003" + - "\310\001\001R\003val\0326\n\010ValEntry\022\020\n\003key\030\001 \001(\tR\003key\022\024" + - "\n\005value\030\002 \001(\tR\005value:\0028\001B\334\001\n$build.buf.v" + - "alidate.conformance.casesB\030RequiredField" + - "Proto3ProtoP\001\242\002\004BVCC\252\002\036Buf.Validate.Conf" + - "ormance.Cases\312\002\036Buf\\Validate\\Conformance" + - "\\Cases\342\002*Buf\\Validate\\Conformance\\Cases\\" + - "GPBMetadata\352\002!Buf::Validate::Conformance" + - "::Casesb\006proto3" + "\272H\003\310\001\001R\003val\"?\n RequiredProto3ScalarIgnor" + + "eAlways\022\033\n\003val\030\001 \001(\tB\t\272H\006\310\001\001\330\001\003R\003val\"E\n\034" + + "RequiredProto3OptionalScalar\022\035\n\003val\030\001 \001(" + + "\tB\006\272H\003\310\001\001H\000R\003val\210\001\001B\006\n\004_val\"T\n(RequiredP" + + "roto3OptionalScalarIgnoreAlways\022 \n\003val\030\001" + + " \001(\tB\t\272H\006\310\001\001\330\001\003H\000R\003val\210\001\001B\006\n\004_val\"\205\001\n\025Re" + + "quiredProto3Message\022S\n\003val\030\001 \001(\01329.buf.v" + + "alidate.conformance.cases.RequiredProto3" + + "Message.MsgB\006\272H\003\310\001\001R\003val\032\027\n\003Msg\022\020\n\003val\030\001" + + " \001(\tR\003val\"\240\001\n!RequiredProto3MessageIgnor" + + "eAlways\022b\n\003val\030\001 \001(\0132E.buf.validate.conf" + + "ormance.cases.RequiredProto3MessageIgnor" + + "eAlways.MsgB\t\272H\006\310\001\001\330\001\003R\003val\032\027\n\003Msg\022\020\n\003va" + + "l\030\001 \001(\tR\003val\"D\n\023RequiredProto3OneOf\022\026\n\001a" + + "\030\001 \001(\tB\006\272H\003\310\001\001H\000R\001a\022\016\n\001b\030\002 \001(\tH\000R\001bB\005\n\003v" + + "al\"S\n\037RequiredProto3OneOfIgnoreAlways\022\031\n" + + "\001a\030\001 \001(\tB\t\272H\006\310\001\001\330\001\003H\000R\001a\022\016\n\001b\030\002 \001(\tH\000R\001b" + + "B\005\n\003val\"2\n\026RequiredProto3Repeated\022\030\n\003val" + + "\030\001 \003(\tB\006\272H\003\310\001\001R\003val\"A\n\"RequiredProto3Rep" + + "eatedIgnoreAlways\022\033\n\003val\030\001 \003(\tB\t\272H\006\310\001\001\330\001" + + "\003R\003val\"\241\001\n\021RequiredProto3Map\022T\n\003val\030\001 \003(" + + "\0132:.buf.validate.conformance.cases.Requi" + + "redProto3Map.ValEntryB\006\272H\003\310\001\001R\003val\0326\n\010Va" + + "lEntry\022\020\n\003key\030\001 \001(\tR\003key\022\024\n\005value\030\002 \001(\tR" + + "\005value:\0028\001\"\274\001\n\035RequiredProto3MapIgnoreAl" + + "ways\022c\n\003val\030\001 \003(\0132F.buf.validate.conform" + + "ance.cases.RequiredProto3MapIgnoreAlways" + + ".ValEntryB\t\272H\006\310\001\001\330\001\003R\003val\0326\n\010ValEntry\022\020\n" + + "\003key\030\001 \001(\tR\003key\022\024\n\005value\030\002 \001(\tR\005value:\0028" + + "\001B\334\001\n$build.buf.validate.conformance.cas" + + "esB\030RequiredFieldProto3ProtoP\001\242\002\004BVCC\252\002\036" + + "Buf.Validate.Conformance.Cases\312\002\036Buf\\Val" + + "idate\\Conformance\\Cases\342\002*Buf\\Validate\\C" + + "onformance\\Cases\\GPBMetadata\352\002!Buf::Vali" + + "date::Conformance::Casesb\006proto3" }; descriptor = com.google.protobuf.Descriptors.FileDescriptor .internalBuildGeneratedFileFrom(descriptorData, @@ -109,14 +165,26 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto3Scalar_descriptor, new java.lang.String[] { "Val", }); - internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalar_descriptor = + internal_static_buf_validate_conformance_cases_RequiredProto3ScalarIgnoreAlways_descriptor = getDescriptor().getMessageTypes().get(1); + internal_static_buf_validate_conformance_cases_RequiredProto3ScalarIgnoreAlways_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto3ScalarIgnoreAlways_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalar_descriptor = + getDescriptor().getMessageTypes().get(2); internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalar_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalar_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalarIgnoreAlways_descriptor = + getDescriptor().getMessageTypes().get(3); + internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalarIgnoreAlways_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalarIgnoreAlways_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RequiredProto3Message_descriptor = - getDescriptor().getMessageTypes().get(2); + getDescriptor().getMessageTypes().get(4); internal_static_buf_validate_conformance_cases_RequiredProto3Message_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto3Message_descriptor, @@ -127,20 +195,44 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto3Message_Msg_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_descriptor = + getDescriptor().getMessageTypes().get(5); + internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_Msg_descriptor = + internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_Msg_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_Msg_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RequiredProto3OneOf_descriptor = - getDescriptor().getMessageTypes().get(3); + getDescriptor().getMessageTypes().get(6); internal_static_buf_validate_conformance_cases_RequiredProto3OneOf_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto3OneOf_descriptor, new java.lang.String[] { "A", "B", "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto3OneOfIgnoreAlways_descriptor = + getDescriptor().getMessageTypes().get(7); + internal_static_buf_validate_conformance_cases_RequiredProto3OneOfIgnoreAlways_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto3OneOfIgnoreAlways_descriptor, + new java.lang.String[] { "A", "B", "Val", }); internal_static_buf_validate_conformance_cases_RequiredProto3Repeated_descriptor = - getDescriptor().getMessageTypes().get(4); + getDescriptor().getMessageTypes().get(8); internal_static_buf_validate_conformance_cases_RequiredProto3Repeated_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto3Repeated_descriptor, new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto3RepeatedIgnoreAlways_descriptor = + getDescriptor().getMessageTypes().get(9); + internal_static_buf_validate_conformance_cases_RequiredProto3RepeatedIgnoreAlways_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto3RepeatedIgnoreAlways_descriptor, + new java.lang.String[] { "Val", }); internal_static_buf_validate_conformance_cases_RequiredProto3Map_descriptor = - getDescriptor().getMessageTypes().get(5); + getDescriptor().getMessageTypes().get(10); internal_static_buf_validate_conformance_cases_RequiredProto3Map_fieldAccessorTable = new com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto3Map_descriptor, @@ -151,6 +243,18 @@ public static void registerAllExtensions( com.google.protobuf.GeneratedMessage.FieldAccessorTable( internal_static_buf_validate_conformance_cases_RequiredProto3Map_ValEntry_descriptor, new java.lang.String[] { "Key", "Value", }); + internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_descriptor = + getDescriptor().getMessageTypes().get(11); + internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_descriptor, + new java.lang.String[] { "Val", }); + internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_ValEntry_descriptor = + internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_descriptor.getNestedTypes().get(0); + internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_ValEntry_fieldAccessorTable = new + com.google.protobuf.GeneratedMessage.FieldAccessorTable( + internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_ValEntry_descriptor, + new java.lang.String[] { "Key", "Value", }); descriptor.resolveAllFeaturesImmutable(); build.buf.validate.ValidateProto.getDescriptor(); com.google.protobuf.ExtensionRegistry registry = diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredFieldProtoEditionsProto.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredFieldProtoEditionsProto.java index 9b6e08c0..1f601195 100644 --- a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredFieldProtoEditionsProto.java +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredFieldProtoEditionsProto.java @@ -30,16 +30,31 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceDefault_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceDefault_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredEditionsScalarExplicitPresenceDefaultIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredEditionsScalarImplicitPresence_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredEditionsScalarImplicitPresence_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredEditionsScalarImplicitPresenceIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredEditionsScalarImplicitPresenceIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredEditionsScalarLegacyRequired_descriptor; static final @@ -55,6 +70,16 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresence_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceIgnoreAlways_Msg_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimited_descriptor; static final @@ -65,6 +90,16 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimited_Msg_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_Msg_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredEditionsMessageExplicitPresenceDelimitedIgnoreAlways_Msg_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredEditionsMessageLegacyRequired_descriptor; static final @@ -90,16 +125,31 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredEditionsOneof_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredEditionsOneofIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredEditionsOneofIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredEditionsRepeated_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredEditionsRepeated_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedExpanded_descriptor; static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedExpanded_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedExpandedIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredEditionsRepeatedExpandedIgnoreAlways_fieldAccessorTable; static final com.google.protobuf.Descriptors.Descriptor internal_static_buf_validate_conformance_cases_RequiredEditionsMap_descriptor; static final @@ -110,6 +160,16 @@ public static void registerAllExtensions( static final com.google.protobuf.GeneratedMessage.FieldAccessorTable internal_static_buf_validate_conformance_cases_RequiredEditionsMap_ValEntry_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredEditionsMapIgnoreAlways_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredEditionsMapIgnoreAlways_fieldAccessorTable; + static final com.google.protobuf.Descriptors.Descriptor + internal_static_buf_validate_conformance_cases_RequiredEditionsMapIgnoreAlways_ValEntry_descriptor; + static final + com.google.protobuf.GeneratedMessage.FieldAccessorTable + internal_static_buf_validate_conformance_cases_RequiredEditionsMapIgnoreAlways_ValEntry_fieldAccessorTable; public static com.google.protobuf.Descriptors.FileDescriptor getDescriptor() { @@ -123,46 +183,74 @@ public static void registerAllExtensions( "d_field_proto_editions.proto\022\036buf.valida" + "te.conformance.cases\032\033buf/validate/valid" + "ate.proto\"B\n&RequiredEditionsScalarExpli" + - "citPresence\022\030\n\003val\030\001 \001(\tB\006\272H\003\310\001\001R\003val\"N\n" + - "-RequiredEditionsScalarExplicitPresenceD" + - "efault\022\035\n\003val\030\001 \001(\t:\003fooB\006\272H\003\310\001\001R\003val\"G\n" + - "&RequiredEditionsScalarImplicitPresence\022" + - "\035\n\003val\030\001 \001(\tB\013\252\001\002\010\002\272H\003\310\001\001R\003val\"E\n$Requir" + - "edEditionsScalarLegacyRequired\022\035\n\003val\030\001 " + - "\001(\tB\013\252\001\002\010\003\272H\003\310\001\001R\003val\"\251\001\n\'RequiredEditio" + - "nsMessageExplicitPresence\022e\n\003val\030\001 \001(\0132K" + - ".buf.validate.conformance.cases.Required" + - "EditionsMessageExplicitPresence.MsgB\006\272H\003" + - "\310\001\001R\003val\032\027\n\003Msg\022\020\n\003val\030\001 \001(\tR\003val\"\300\001\n0Re" + + "citPresence\022\030\n\003val\030\001 \001(\tB\006\272H\003\310\001\001R\003val\"Q\n" + + "2RequiredEditionsScalarExplicitPresenceI" + + "gnoreAlways\022\033\n\003val\030\001 \001(\tB\t\272H\006\310\001\001\330\001\003R\003val" + + "\"N\n-RequiredEditionsScalarExplicitPresen" + + "ceDefault\022\035\n\003val\030\001 \001(\t:\003fooB\006\272H\003\310\001\001R\003val" + + "\"]\n9RequiredEditionsScalarExplicitPresen" + + "ceDefaultIgnoreAlways\022 \n\003val\030\001 \001(\t:\003fooB" + + "\t\272H\006\310\001\001\330\001\003R\003val\"G\n&RequiredEditionsScala" + + "rImplicitPresence\022\035\n\003val\030\001 \001(\tB\013\252\001\002\010\002\272H\003" + + "\310\001\001R\003val\"V\n2RequiredEditionsScalarImplic" + + "itPresenceIgnoreAlways\022 \n\003val\030\001 \001(\tB\016\252\001\002" + + "\010\002\272H\006\310\001\001\330\001\003R\003val\"E\n$RequiredEditionsScal" + + "arLegacyRequired\022\035\n\003val\030\001 \001(\tB\013\252\001\002\010\003\272H\003\310" + + "\001\001R\003val\"\251\001\n\'RequiredEditionsMessageExpli" + + "citPresence\022e\n\003val\030\001 \001(\0132K.buf.validate." + + "conformance.cases.RequiredEditionsMessag" + + "eExplicitPresence.MsgB\006\272H\003\310\001\001R\003val\032\027\n\003Ms" + + "g\022\020\n\003val\030\001 \001(\tR\003val\"\304\001\n3RequiredEditions" + + "MessageExplicitPresenceIgnoreAlways\022t\n\003v" + + "al\030\001 \001(\0132W.buf.validate.conformance.case" + + "s.RequiredEditionsMessageExplicitPresenc" + + "eIgnoreAlways.MsgB\t\272H\006\310\001\001\330\001\003R\003val\032\027\n\003Msg" + + "\022\020\n\003val\030\001 \001(\tR\003val\"\300\001\n0RequiredEditionsM" + + "essageExplicitPresenceDelimited\022s\n\003val\030\001" + + " \001(\0132T.buf.validate.conformance.cases.Re" + "quiredEditionsMessageExplicitPresenceDel" + - "imited\022s\n\003val\030\001 \001(\0132T.buf.validate.confo" + - "rmance.cases.RequiredEditionsMessageExpl" + - "icitPresenceDelimited.MsgB\013\252\001\002(\002\272H\003\310\001\001R\003" + - "val\032\027\n\003Msg\022\020\n\003val\030\001 \001(\tR\003val\"\252\001\n%Require" + - "dEditionsMessageLegacyRequired\022h\n\003val\030\001 " + - "\001(\0132I.buf.validate.conformance.cases.Req" + - "uiredEditionsMessageLegacyRequired.MsgB\013" + - "\252\001\002\010\003\272H\003\310\001\001R\003val\032\027\n\003Msg\022\020\n\003val\030\001 \001(\tR\003va" + - "l\"\276\001\n.RequiredEditionsMessageLegacyRequi" + - "redDelimited\022s\n\003val\030\001 \001(\0132R.buf.validate" + - ".conformance.cases.RequiredEditionsMessa" + - "geLegacyRequiredDelimited.MsgB\r\252\001\004\010\003(\002\272H" + - "\003\310\001\001R\003val\032\027\n\003Msg\022\020\n\003val\030\001 \001(\tR\003val\"F\n\025Re" + - "quiredEditionsOneof\022\026\n\001a\030\001 \001(\tB\006\272H\003\310\001\001H\000" + - "R\001a\022\016\n\001b\030\002 \001(\tH\000R\001bB\005\n\003val\"4\n\030RequiredEd" + - "itionsRepeated\022\030\n\003val\030\001 \003(\tB\006\272H\003\310\001\001R\003val" + - "\"A\n RequiredEditionsRepeatedExpanded\022\035\n\003" + - "val\030\001 \003(\tB\013\252\001\002\030\002\272H\003\310\001\001R\003val\"\245\001\n\023Required" + - "EditionsMap\022V\n\003val\030\001 \003(\0132<.buf.validate." + - "conformance.cases.RequiredEditionsMap.Va" + - "lEntryB\006\272H\003\310\001\001R\003val\0326\n\010ValEntry\022\020\n\003key\030\001" + - " \001(\tR\003key\022\024\n\005value\030\002 \001(\tR\005value:\0028\001B\343\001\n$" + - "build.buf.validate.conformance.casesB\037Re" + - "quiredFieldProtoEditionsProtoP\001\242\002\004BVCC\252\002" + - "\036Buf.Validate.Conformance.Cases\312\002\036Buf\\Va" + - "lidate\\Conformance\\Cases\342\002*Buf\\Validate\\" + - "Conformance\\Cases\\GPBMetadata\352\002!Buf::Val" + - "idate::Conformance::Casesb\010editionsp\350\007" + "imited.MsgB\013\252\001\002(\002\272H\003\310\001\001R\003val\032\027\n\003Msg\022\020\n\003v" + + "al\030\001 \001(\tR\003val\"\334\001\n builder) { + super(builder); + } + private RequiredProto2MapIgnoreAlways() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> 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<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public /* nullable */ +java.lang.String getValOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.lang.String getValOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map 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.GeneratedMessage + .serializeStringMapTo( + 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.RequiredProto2MapIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways) 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.RequiredProto2MapIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways 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.RequiredProto2MapIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways 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.RequiredProto2MapIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways 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.RequiredProto2MapIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto2MapIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways) + build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MapIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways.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.String, java.lang.String> 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<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public /* nullable */ +java.lang.String getValOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.lang.String getValOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map 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<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map 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<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredProto2MapIgnoreAlways 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.RequiredProto2MapIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MapIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MapIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..90b2f411 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MapIgnoreAlwaysOrBuilder.java @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto2.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredProto2MapIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto2MapIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + java.lang.String key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + /* nullable */ +java.lang.String getValOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.lang.String getValOrThrow( + java.lang.String key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MessageIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MessageIgnoreAlways.java new file mode 100644 index 00000000..8bfaa54c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MessageIgnoreAlways.java @@ -0,0 +1,1100 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto2.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways} + */ +public final class RequiredProto2MessageIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways) + RequiredProto2MessageIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredProto2MessageIgnoreAlways.class.getName()); + } + // Use RequiredProto2MessageIgnoreAlways.newBuilder() to construct. + private RequiredProto2MessageIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredProto2MessageIgnoreAlways() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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.RequiredProto2MessageIgnoreAlways.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + Msg.class.getName()); + } + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.class, build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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.GeneratedMessage.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.GeneratedMessage.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.RequiredProto2MessageIgnoreAlways.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg other = (build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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.RequiredProto2MessageIgnoreAlways.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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.RequiredProto2MessageIgnoreAlways.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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.RequiredProto2MessageIgnoreAlways.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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.RequiredProto2MessageIgnoreAlways.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto2MessageIgnoreAlways.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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg) + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.class, build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg build() { + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg buildPartial() { + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg result = new build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg other) { + if (other == build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg) + private static final build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg(); + } + + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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.RequiredProto2MessageIgnoreAlways.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg val_; + /** + * optional .buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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.RequiredProto2MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.getDefaultInstance() : val_; + } + /** + * optional .buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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.RequiredProto2MessageIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways) 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.RequiredProto2MessageIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways 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.RequiredProto2MessageIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways 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.RequiredProto2MessageIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways 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.RequiredProto2MessageIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto2MessageIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways) + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetValFieldBuilder(); + } + } + @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.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2MessageIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways 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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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( + internalGetValFieldBuilder().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.RequiredProto2MessageIgnoreAlways.Msg val_; + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg, build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.Builder, build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.MsgOrBuilder> valBuilder_; + /** + * optional .buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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.RequiredProto2MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * optional .buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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.RequiredProto2MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * optional .buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.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.RequiredProto2MessageIgnoreAlways.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.RequiredProto2MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetValFieldBuilder().getBuilder(); + } + /** + * optional .buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.getDefaultInstance() : val_; + } + } + /** + * optional .buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg, build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.Builder, build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.MsgOrBuilder> + internalGetValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg, build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg.Builder, build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredProto2MessageIgnoreAlways 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.RequiredProto2MessageIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MessageIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MessageIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..caeb91cf --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2MessageIgnoreAlwaysOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto2.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredProto2MessageIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * optional .buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional .buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg getVal(); + /** + * optional .buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.RequiredProto2MessageIgnoreAlways.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2OneofIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2OneofIgnoreAlways.java new file mode 100644 index 00000000..ce3a3d43 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2OneofIgnoreAlways.java @@ -0,0 +1,788 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto2.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways} + */ +public final class RequiredProto2OneofIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways) + RequiredProto2OneofIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredProto2OneofIgnoreAlways.class.getName()); + } + // Use RequiredProto2OneofIgnoreAlways.newBuilder() to construct. + private RequiredProto2OneofIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredProto2OneofIgnoreAlways() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2OneofIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2OneofIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways.Builder.class); + } + + private int valCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object val_; + public enum ValCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + A(1), + B(2), + VAL_NOT_SET(0); + private final int value; + private ValCase(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 ValCase valueOf(int value) { + return forNumber(value); + } + + public static ValCase forNumber(int value) { + switch (value) { + case 1: return A; + case 2: return B; + case 0: return VAL_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ValCase + getValCase() { + return ValCase.forNumber( + valCase_); + } + + public static final int A_FIELD_NUMBER = 1; + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + public boolean hasA() { + return valCase_ == 1; + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + public java.lang.String getA() { + java.lang.Object ref = ""; + if (valCase_ == 1) { + 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() && (valCase_ == 1)) { + val_ = s; + } + return s; + } + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The bytes for a. + */ + public com.google.protobuf.ByteString + getABytes() { + java.lang.Object ref = ""; + if (valCase_ == 1) { + ref = val_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valCase_ == 1) { + val_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int B_FIELD_NUMBER = 2; + /** + * string b = 2 [json_name = "b"]; + * @return Whether the b field is set. + */ + public boolean hasB() { + return valCase_ == 2; + } + /** + * string b = 2 [json_name = "b"]; + * @return The b. + */ + public java.lang.String getB() { + java.lang.Object ref = ""; + if (valCase_ == 2) { + 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() && (valCase_ == 2)) { + val_ = s; + } + return s; + } + } + /** + * string b = 2 [json_name = "b"]; + * @return The bytes for b. + */ + public com.google.protobuf.ByteString + getBBytes() { + java.lang.Object ref = ""; + if (valCase_ == 2) { + ref = val_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valCase_ == 2) { + 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 (valCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, val_); + } + if (valCase_ == 2) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, val_); + } + if (valCase_ == 2) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, 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.RequiredProto2OneofIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways) obj; + + if (!getValCase().equals(other.getValCase())) return false; + switch (valCase_) { + case 1: + if (!getA() + .equals(other.getA())) return false; + break; + case 2: + if (!getB() + .equals(other.getB())) 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 (valCase_) { + case 1: + hash = (37 * hash) + A_FIELD_NUMBER; + hash = (53 * hash) + getA().hashCode(); + break; + case 2: + hash = (37 * hash) + B_FIELD_NUMBER; + hash = (53 * hash) + getB().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways 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.RequiredProto2OneofIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways 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.RequiredProto2OneofIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways 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.RequiredProto2OneofIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto2OneofIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways) + build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2OneofIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2OneofIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + valCase_ = 0; + val_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2OneofIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways result) { + result.valCase_ = valCase_; + result.val_ = this.val_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways.getDefaultInstance()) return this; + switch (other.getValCase()) { + case A: { + valCase_ = 1; + val_ = other.val_; + onChanged(); + break; + } + case B: { + valCase_ = 2; + val_ = other.val_; + onChanged(); + break; + } + case VAL_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 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + valCase_ = 1; + val_ = bs; + break; + } // case 10 + case 18: { + com.google.protobuf.ByteString bs = input.readBytes(); + valCase_ = 2; + val_ = bs; + break; + } // case 18 + 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 valCase_ = 0; + private java.lang.Object val_; + public ValCase + getValCase() { + return ValCase.forNumber( + valCase_); + } + + public Builder clearVal() { + valCase_ = 0; + val_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + @java.lang.Override + public boolean hasA() { + return valCase_ == 1; + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public java.lang.String getA() { + java.lang.Object ref = ""; + if (valCase_ == 1) { + 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 (valCase_ == 1) { + if (bs.isValidUtf8()) { + val_ = s; + } + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The bytes for a. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getABytes() { + java.lang.Object ref = ""; + if (valCase_ == 1) { + ref = val_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valCase_ == 1) { + val_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @param value The a to set. + * @return This builder for chaining. + */ + public Builder setA( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + valCase_ = 1; + val_ = value; + onChanged(); + return this; + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearA() { + if (valCase_ == 1) { + valCase_ = 0; + val_ = null; + onChanged(); + } + return this; + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @param value The bytes for a to set. + * @return This builder for chaining. + */ + public Builder setABytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + valCase_ = 1; + val_ = value; + onChanged(); + return this; + } + + /** + * string b = 2 [json_name = "b"]; + * @return Whether the b field is set. + */ + @java.lang.Override + public boolean hasB() { + return valCase_ == 2; + } + /** + * string b = 2 [json_name = "b"]; + * @return The b. + */ + @java.lang.Override + public java.lang.String getB() { + java.lang.Object ref = ""; + if (valCase_ == 2) { + 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 (valCase_ == 2) { + if (bs.isValidUtf8()) { + val_ = s; + } + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string b = 2 [json_name = "b"]; + * @return The bytes for b. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBBytes() { + java.lang.Object ref = ""; + if (valCase_ == 2) { + ref = val_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valCase_ == 2) { + val_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string b = 2 [json_name = "b"]; + * @param value The b to set. + * @return This builder for chaining. + */ + public Builder setB( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + valCase_ = 2; + val_ = value; + onChanged(); + return this; + } + /** + * string b = 2 [json_name = "b"]; + * @return This builder for chaining. + */ + public Builder clearB() { + if (valCase_ == 2) { + valCase_ = 0; + val_ = null; + onChanged(); + } + return this; + } + /** + * string b = 2 [json_name = "b"]; + * @param value The bytes for b to set. + * @return This builder for chaining. + */ + public Builder setBBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + valCase_ = 2; + val_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredProto2OneofIgnoreAlways 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.RequiredProto2OneofIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2OneofIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2OneofIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..52d3a73f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2OneofIgnoreAlwaysOrBuilder.java @@ -0,0 +1,47 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto2.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredProto2OneofIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + boolean hasA(); + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + java.lang.String getA(); + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The bytes for a. + */ + com.google.protobuf.ByteString + getABytes(); + + /** + * string b = 2 [json_name = "b"]; + * @return Whether the b field is set. + */ + boolean hasB(); + /** + * string b = 2 [json_name = "b"]; + * @return The b. + */ + java.lang.String getB(); + /** + * string b = 2 [json_name = "b"]; + * @return The bytes for b. + */ + com.google.protobuf.ByteString + getBBytes(); + + build.buf.validate.conformance.cases.RequiredProto2OneofIgnoreAlways.ValCase getValCase(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2RepeatedIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2RepeatedIgnoreAlways.java new file mode 100644 index 00000000..1a94ec0a --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2RepeatedIgnoreAlways.java @@ -0,0 +1,553 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto2.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways} + */ +public final class RequiredProto2RepeatedIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways) + RequiredProto2RepeatedIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredProto2RepeatedIgnoreAlways.class.getName()); + } + // Use RequiredProto2RepeatedIgnoreAlways.newBuilder() to construct. + private RequiredProto2RepeatedIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredProto2RepeatedIgnoreAlways() { + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2RepeatedIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2RepeatedIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public com.google.protobuf.ProtocolStringList + getValList() { + return val_; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated string 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 java.lang.String getVal(int index) { + return val_.get(index); + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the value to return. + * @return The bytes of the val at the given index. + */ + public com.google.protobuf.ByteString + getValBytes(int index) { + return val_.getByteString(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++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, val_.getRaw(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 += computeStringSizeNoTag(val_.getRaw(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.RequiredProto2RepeatedIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways) 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.RequiredProto2RepeatedIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways 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.RequiredProto2RepeatedIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways 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.RequiredProto2RepeatedIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways 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.RequiredProto2RepeatedIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto2RepeatedIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways) + build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2RepeatedIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2RepeatedIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2RepeatedIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + 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 10: { + com.google.protobuf.ByteString bs = input.readBytes(); + ensureValIsMutable(); + val_.add(bs); + 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.LazyStringArrayList val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = new com.google.protobuf.LazyStringArrayList(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public com.google.protobuf.ProtocolStringList + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated string 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 java.lang.String getVal(int index) { + return val_.get(index); + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the value to return. + * @return The bytes of the val at the given index. + */ + public com.google.protobuf.ByteString + getValBytes(int index) { + return val_.getByteString(index); + } + /** + * repeated string 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, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureValIsMutable(); + val_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureValIsMutable(); + val_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string 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 string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The bytes of the val to add. + * @return This builder for chaining. + */ + public Builder addValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + ensureValIsMutable(); + val_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredProto2RepeatedIgnoreAlways 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.RequiredProto2RepeatedIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2RepeatedIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2RepeatedIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..884c639f --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2RepeatedIgnoreAlwaysOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto2.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredProto2RepeatedIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto2RepeatedIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List + getValList(); + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + java.lang.String getVal(int index); + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the value to return. + * @return The bytes of the val at the given index. + */ + com.google.protobuf.ByteString + getValBytes(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalDefaultIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalDefaultIgnoreAlways.java new file mode 100644 index 00000000..04c472e3 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalDefaultIgnoreAlways.java @@ -0,0 +1,528 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto2.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways} + */ +public final class RequiredProto2ScalarOptionalDefaultIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways) + RequiredProto2ScalarOptionalDefaultIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredProto2ScalarOptionalDefaultIgnoreAlways.class.getName()); + } + // Use RequiredProto2ScalarOptionalDefaultIgnoreAlways.newBuilder() to construct. + private RequiredProto2ScalarOptionalDefaultIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredProto2ScalarOptionalDefaultIgnoreAlways() { + val_ = "foo"; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefaultIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefaultIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways.Builder.class); + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = "foo"; + /** + * optional string val = 1 [default = "foo", json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [default = "foo", 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(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } + } + /** + * optional string val = 1 [default = "foo", 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 (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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.RequiredProto2ScalarOptionalDefaultIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways) 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.RequiredProto2ScalarOptionalDefaultIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways 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.RequiredProto2ScalarOptionalDefaultIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways 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.RequiredProto2ScalarOptionalDefaultIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways 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.RequiredProto2ScalarOptionalDefaultIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto2ScalarOptionalDefaultIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways) + build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefaultIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefaultIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = "foo"; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalDefaultIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways 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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways.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_ = "foo"; + /** + * optional string val = 1 [default = "foo", json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional string val = 1 [default = "foo", 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(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional string val = 1 [default = "foo", 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; + } + } + /** + * optional string val = 1 [default = "foo", 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; + } + /** + * optional string val = 1 [default = "foo", json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * optional string val = 1 [default = "foo", 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(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredProto2ScalarOptionalDefaultIgnoreAlways 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.RequiredProto2ScalarOptionalDefaultIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalDefaultIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalDefaultIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..53954fdb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalDefaultIgnoreAlwaysOrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto2.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredProto2ScalarOptionalDefaultIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto2ScalarOptionalDefaultIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [default = "foo", json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [default = "foo", json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * optional string val = 1 [default = "foo", 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/RequiredProto2ScalarOptionalIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalIgnoreAlways.java new file mode 100644 index 00000000..13e695fc --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalIgnoreAlways.java @@ -0,0 +1,528 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto2.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways} + */ +public final class RequiredProto2ScalarOptionalIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways) + RequiredProto2ScalarOptionalIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredProto2ScalarOptionalIgnoreAlways.class.getName()); + } + // Use RequiredProto2ScalarOptionalIgnoreAlways.newBuilder() to construct. + private RequiredProto2ScalarOptionalIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredProto2ScalarOptionalIgnoreAlways() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways.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", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional 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(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } + } + /** + * optional 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 (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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.RequiredProto2ScalarOptionalIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways) 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.RequiredProto2ScalarOptionalIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways 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.RequiredProto2ScalarOptionalIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways 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.RequiredProto2ScalarOptionalIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways 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.RequiredProto2ScalarOptionalIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto2ScalarOptionalIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways) + build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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.RequiredFieldProto2Proto.internal_static_buf_validate_conformance_cases_RequiredProto2ScalarOptionalIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways 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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways.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", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional 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(); + if (bs.isValidUtf8()) { + val_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * optional 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; + } + } + /** + * optional 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; + } + /** + * optional 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; + } + /** + * optional 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(); } + val_ = value; + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredProto2ScalarOptionalIgnoreAlways 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.RequiredProto2ScalarOptionalIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..ddd77de2 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto2ScalarOptionalIgnoreAlwaysOrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto2.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredProto2ScalarOptionalIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto2ScalarOptionalIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * optional 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/RequiredProto3MapIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MapIgnoreAlways.java new file mode 100644 index 00000000..9cba5ffb --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MapIgnoreAlways.java @@ -0,0 +1,644 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto3.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways} + */ +public final class RequiredProto3MapIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways) + RequiredProto3MapIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredProto3MapIgnoreAlways.class.getName()); + } + // Use RequiredProto3MapIgnoreAlways.newBuilder() to construct. + private RequiredProto3MapIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredProto3MapIgnoreAlways() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + @java.lang.Override + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + private static final class ValDefaultEntryHolder { + static final com.google.protobuf.MapEntry< + java.lang.String, java.lang.String> defaultEntry = + com.google.protobuf.MapEntry + .newDefaultInstance( + build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_ValEntry_descriptor, + com.google.protobuf.WireFormat.FieldType.STRING, + "", + com.google.protobuf.WireFormat.FieldType.STRING, + ""); + } + @SuppressWarnings("serial") + private com.google.protobuf.MapField< + java.lang.String, java.lang.String> 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<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public /* nullable */ +java.lang.String getValOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.lang.String getValOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map 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.GeneratedMessage + .serializeStringMapTo( + 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.RequiredProto3MapIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways) 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.RequiredProto3MapIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways 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.RequiredProto3MapIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways 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.RequiredProto3MapIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways 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.RequiredProto3MapIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto3MapIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways) + build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_descriptor; + } + + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @SuppressWarnings({"rawtypes"}) + protected com.google.protobuf.MapFieldReflectionAccessor internalGetMutableMapFieldReflection( + int number) { + switch (number) { + case 1: + return internalGetMutableVal(); + default: + throw new RuntimeException( + "Invalid map field number: " + number); + } + } + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MapIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = internalGetVal(); + result.val_.makeImmutable(); + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways.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.String, java.lang.String> 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<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public boolean containsVal( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map key"); } + return internalGetVal().getMap().containsKey(key); + } + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Override + @java.lang.Deprecated + public java.util.Map getVal() { + return getValMap(); + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.util.Map getValMap() { + return internalGetVal().getMap(); + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public /* nullable */ +java.lang.String getValOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue) { + if (key == null) { throw new NullPointerException("map key"); } + java.util.Map map = + internalGetVal().getMap(); + return map.containsKey(key) ? map.get(key) : defaultValue; + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public java.lang.String getValOrThrow( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map 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<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder removeVal( + java.lang.String key) { + if (key == null) { throw new NullPointerException("map 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<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putVal( + java.lang.String key, + java.lang.String value) { + if (key == null) { throw new NullPointerException("map key"); } + if (value == null) { throw new NullPointerException("map value"); } + internalGetMutableVal().getMutableMap() + .put(key, value); + bitField0_ |= 0x00000001; + return this; + } + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder putAllVal( + java.util.Map values) { + internalGetMutableVal().getMutableMap() + .putAll(values); + bitField0_ |= 0x00000001; + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredProto3MapIgnoreAlways 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.RequiredProto3MapIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MapIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MapIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..a773cc50 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MapIgnoreAlwaysOrBuilder.java @@ -0,0 +1,45 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto3.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredProto3MapIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto3MapIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + int getValCount(); + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + boolean containsVal( + java.lang.String key); + /** + * Use {@link #getValMap()} instead. + */ + @java.lang.Deprecated + java.util.Map + getVal(); + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.util.Map + getValMap(); + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + /* nullable */ +java.lang.String getValOrDefault( + java.lang.String key, + /* nullable */ +java.lang.String defaultValue); + /** + * map<string, string> val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + java.lang.String getValOrThrow( + java.lang.String key); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MessageIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MessageIgnoreAlways.java new file mode 100644 index 00000000..e5674c1c --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MessageIgnoreAlways.java @@ -0,0 +1,1068 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto3.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways} + */ +public final class RequiredProto3MessageIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways) + RequiredProto3MessageIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredProto3MessageIgnoreAlways.class.getName()); + } + // Use RequiredProto3MessageIgnoreAlways.newBuilder() to construct. + private RequiredProto3MessageIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredProto3MessageIgnoreAlways() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Builder.class); + } + + public interface MsgOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg) + com.google.protobuf.MessageOrBuilder { + + /** + * string val = 1 [json_name = "val"]; + * @return The val. + */ + java.lang.String getVal(); + /** + * string val = 1 [json_name = "val"]; + * @return The bytes for val. + */ + com.google.protobuf.ByteString + getValBytes(); + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg} + */ + public static final class Msg extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg) + MsgOrBuilder { + private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + Msg.class.getName()); + } + // Use Msg.newBuilder() to construct. + private Msg(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private Msg() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.class, build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private volatile java.lang.Object val_ = ""; + /** + * 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; + } + } + /** + * 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 (!com.google.protobuf.GeneratedMessage.isStringEmpty(val_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(val_)) { + size += com.google.protobuf.GeneratedMessage.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.RequiredProto3MessageIgnoreAlways.Msg)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg other = (build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg) 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.RequiredProto3MessageIgnoreAlways.Msg parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.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.RequiredProto3MessageIgnoreAlways.Msg parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.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.RequiredProto3MessageIgnoreAlways.Msg parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.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.RequiredProto3MessageIgnoreAlways.Msg parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto3MessageIgnoreAlways.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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg) + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.MsgOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_Msg_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_Msg_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.class, build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_Msg_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg build() { + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg buildPartial() { + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg result = new build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg other) { + if (other == build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.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"]; + * @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"]; + * @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"]; + * @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"]; + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = getDefaultInstance().getVal(); + bitField0_ = (bitField0_ & ~0x00000001); + onChanged(); + return this; + } + /** + * 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; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg) + private static final build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg(); + } + + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.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.RequiredProto3MessageIgnoreAlways.Msg getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + + } + + private int bitField0_; + public static final int VAL_FIELD_NUMBER = 1; + private build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg val_; + /** + * .buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.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.RequiredProto3MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg getVal() { + return val_ == null ? build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.getDefaultInstance() : val_; + } + /** + * .buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.MsgOrBuilder getValOrBuilder() { + return val_ == null ? build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.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.RequiredProto3MessageIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways) 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.RequiredProto3MessageIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways 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.RequiredProto3MessageIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways 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.RequiredProto3MessageIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways 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.RequiredProto3MessageIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto3MessageIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways) + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.newBuilder() + private Builder() { + maybeForceBuilderInitialization(); + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + maybeForceBuilderInitialization(); + } + private void maybeForceBuilderInitialization() { + if (com.google.protobuf.GeneratedMessage + .alwaysUseFieldBuilders) { + internalGetValFieldBuilder(); + } + } + @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.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3MessageIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways 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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.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( + internalGetValFieldBuilder().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.RequiredProto3MessageIgnoreAlways.Msg val_; + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg, build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.Builder, build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.MsgOrBuilder> valBuilder_; + /** + * .buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.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.RequiredProto3MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + public build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg getVal() { + if (valBuilder_ == null) { + return val_ == null ? build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.getDefaultInstance() : val_; + } else { + return valBuilder_.getMessage(); + } + } + /** + * .buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal(build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.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.RequiredProto3MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder setVal( + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.Builder builderForValue) { + if (valBuilder_ == null) { + val_ = builderForValue.build(); + } else { + valBuilder_.setMessage(builderForValue.build()); + } + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * .buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public Builder mergeVal(build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg value) { + if (valBuilder_ == null) { + if (((bitField0_ & 0x00000001) != 0) && + val_ != null && + val_ != build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.getDefaultInstance()) { + getValBuilder().mergeFrom(value); + } else { + val_ = value; + } + } else { + valBuilder_.mergeFrom(value); + } + if (val_ != null) { + bitField0_ |= 0x00000001; + onChanged(); + } + return this; + } + /** + * .buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.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.RequiredProto3MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.Builder getValBuilder() { + bitField0_ |= 0x00000001; + onChanged(); + return internalGetValFieldBuilder().getBuilder(); + } + /** + * .buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + public build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.MsgOrBuilder getValOrBuilder() { + if (valBuilder_ != null) { + return valBuilder_.getMessageOrBuilder(); + } else { + return val_ == null ? + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.getDefaultInstance() : val_; + } + } + /** + * .buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + private com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg, build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.Builder, build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.MsgOrBuilder> + internalGetValFieldBuilder() { + if (valBuilder_ == null) { + valBuilder_ = new com.google.protobuf.SingleFieldBuilder< + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg, build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg.Builder, build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.MsgOrBuilder>( + getVal(), + getParentForChildren(), + isClean()); + val_ = null; + } + return valBuilder_; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredProto3MessageIgnoreAlways 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.RequiredProto3MessageIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MessageIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MessageIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..169dd5e9 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3MessageIgnoreAlwaysOrBuilder.java @@ -0,0 +1,26 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto3.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredProto3MessageIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * .buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * .buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg getVal(); + /** + * .buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.Msg val = 1 [json_name = "val", (.buf.validate.field) = { ... } + */ + build.buf.validate.conformance.cases.RequiredProto3MessageIgnoreAlways.MsgOrBuilder getValOrBuilder(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OneOfIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OneOfIgnoreAlways.java new file mode 100644 index 00000000..cee1513d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OneOfIgnoreAlways.java @@ -0,0 +1,786 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto3.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways} + */ +public final class RequiredProto3OneOfIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways) + RequiredProto3OneOfIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredProto3OneOfIgnoreAlways.class.getName()); + } + // Use RequiredProto3OneOfIgnoreAlways.newBuilder() to construct. + private RequiredProto3OneOfIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredProto3OneOfIgnoreAlways() { + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3OneOfIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3OneOfIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways.Builder.class); + } + + private int valCase_ = 0; + @SuppressWarnings("serial") + private java.lang.Object val_; + public enum ValCase + implements com.google.protobuf.Internal.EnumLite, + com.google.protobuf.AbstractMessage.InternalOneOfEnum { + A(1), + B(2), + VAL_NOT_SET(0); + private final int value; + private ValCase(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 ValCase valueOf(int value) { + return forNumber(value); + } + + public static ValCase forNumber(int value) { + switch (value) { + case 1: return A; + case 2: return B; + case 0: return VAL_NOT_SET; + default: return null; + } + } + public int getNumber() { + return this.value; + } + }; + + public ValCase + getValCase() { + return ValCase.forNumber( + valCase_); + } + + public static final int A_FIELD_NUMBER = 1; + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + public boolean hasA() { + return valCase_ == 1; + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + public java.lang.String getA() { + java.lang.Object ref = ""; + if (valCase_ == 1) { + 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 (valCase_ == 1) { + val_ = s; + } + return s; + } + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The bytes for a. + */ + public com.google.protobuf.ByteString + getABytes() { + java.lang.Object ref = ""; + if (valCase_ == 1) { + ref = val_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valCase_ == 1) { + val_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + + public static final int B_FIELD_NUMBER = 2; + /** + * string b = 2 [json_name = "b"]; + * @return Whether the b field is set. + */ + public boolean hasB() { + return valCase_ == 2; + } + /** + * string b = 2 [json_name = "b"]; + * @return The b. + */ + public java.lang.String getB() { + java.lang.Object ref = ""; + if (valCase_ == 2) { + 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 (valCase_ == 2) { + val_ = s; + } + return s; + } + } + /** + * string b = 2 [json_name = "b"]; + * @return The bytes for b. + */ + public com.google.protobuf.ByteString + getBBytes() { + java.lang.Object ref = ""; + if (valCase_ == 2) { + ref = val_; + } + if (ref instanceof java.lang.String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valCase_ == 2) { + 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 (valCase_ == 1) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, val_); + } + if (valCase_ == 2) { + com.google.protobuf.GeneratedMessage.writeString(output, 2, val_); + } + getUnknownFields().writeTo(output); + } + + @java.lang.Override + public int getSerializedSize() { + int size = memoizedSize; + if (size != -1) return size; + + size = 0; + if (valCase_ == 1) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(1, val_); + } + if (valCase_ == 2) { + size += com.google.protobuf.GeneratedMessage.computeStringSize(2, 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.RequiredProto3OneOfIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways) obj; + + if (!getValCase().equals(other.getValCase())) return false; + switch (valCase_) { + case 1: + if (!getA() + .equals(other.getA())) return false; + break; + case 2: + if (!getB() + .equals(other.getB())) 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 (valCase_) { + case 1: + hash = (37 * hash) + A_FIELD_NUMBER; + hash = (53 * hash) + getA().hashCode(); + break; + case 2: + hash = (37 * hash) + B_FIELD_NUMBER; + hash = (53 * hash) + getB().hashCode(); + break; + case 0: + default: + } + hash = (29 * hash) + getUnknownFields().hashCode(); + memoizedHashCode = hash; + return hash; + } + + public static build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways 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.RequiredProto3OneOfIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways 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.RequiredProto3OneOfIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways 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.RequiredProto3OneOfIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto3OneOfIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways) + build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3OneOfIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3OneOfIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + valCase_ = 0; + val_ = null; + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3OneOfIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + buildPartialOneofs(result); + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways result) { + int from_bitField0_ = bitField0_; + } + + private void buildPartialOneofs(build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways result) { + result.valCase_ = valCase_; + result.val_ = this.val_; + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways.getDefaultInstance()) return this; + switch (other.getValCase()) { + case A: { + valCase_ = 1; + val_ = other.val_; + onChanged(); + break; + } + case B: { + valCase_ = 2; + val_ = other.val_; + onChanged(); + break; + } + case VAL_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 10: { + java.lang.String s = input.readStringRequireUtf8(); + valCase_ = 1; + val_ = s; + break; + } // case 10 + case 18: { + java.lang.String s = input.readStringRequireUtf8(); + valCase_ = 2; + val_ = s; + break; + } // case 18 + 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 valCase_ = 0; + private java.lang.Object val_; + public ValCase + getValCase() { + return ValCase.forNumber( + valCase_); + } + + public Builder clearVal() { + valCase_ = 0; + val_ = null; + onChanged(); + return this; + } + + private int bitField0_; + + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + @java.lang.Override + public boolean hasA() { + return valCase_ == 1; + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + @java.lang.Override + public java.lang.String getA() { + java.lang.Object ref = ""; + if (valCase_ == 1) { + 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 (valCase_ == 1) { + val_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The bytes for a. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getABytes() { + java.lang.Object ref = ""; + if (valCase_ == 1) { + ref = val_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valCase_ == 1) { + val_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @param value The a to set. + * @return This builder for chaining. + */ + public Builder setA( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + valCase_ = 1; + val_ = value; + onChanged(); + return this; + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearA() { + if (valCase_ == 1) { + valCase_ = 0; + val_ = null; + onChanged(); + } + return this; + } + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @param value The bytes for a to set. + * @return This builder for chaining. + */ + public Builder setABytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + valCase_ = 1; + val_ = value; + onChanged(); + return this; + } + + /** + * string b = 2 [json_name = "b"]; + * @return Whether the b field is set. + */ + @java.lang.Override + public boolean hasB() { + return valCase_ == 2; + } + /** + * string b = 2 [json_name = "b"]; + * @return The b. + */ + @java.lang.Override + public java.lang.String getB() { + java.lang.Object ref = ""; + if (valCase_ == 2) { + 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 (valCase_ == 2) { + val_ = s; + } + return s; + } else { + return (java.lang.String) ref; + } + } + /** + * string b = 2 [json_name = "b"]; + * @return The bytes for b. + */ + @java.lang.Override + public com.google.protobuf.ByteString + getBBytes() { + java.lang.Object ref = ""; + if (valCase_ == 2) { + ref = val_; + } + if (ref instanceof String) { + com.google.protobuf.ByteString b = + com.google.protobuf.ByteString.copyFromUtf8( + (java.lang.String) ref); + if (valCase_ == 2) { + val_ = b; + } + return b; + } else { + return (com.google.protobuf.ByteString) ref; + } + } + /** + * string b = 2 [json_name = "b"]; + * @param value The b to set. + * @return This builder for chaining. + */ + public Builder setB( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + valCase_ = 2; + val_ = value; + onChanged(); + return this; + } + /** + * string b = 2 [json_name = "b"]; + * @return This builder for chaining. + */ + public Builder clearB() { + if (valCase_ == 2) { + valCase_ = 0; + val_ = null; + onChanged(); + } + return this; + } + /** + * string b = 2 [json_name = "b"]; + * @param value The bytes for b to set. + * @return This builder for chaining. + */ + public Builder setBBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + valCase_ = 2; + val_ = value; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredProto3OneOfIgnoreAlways 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.RequiredProto3OneOfIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OneOfIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OneOfIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..81745594 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OneOfIgnoreAlwaysOrBuilder.java @@ -0,0 +1,47 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto3.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredProto3OneOfIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return Whether the a field is set. + */ + boolean hasA(); + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The a. + */ + java.lang.String getA(); + /** + * string a = 1 [json_name = "a", (.buf.validate.field) = { ... } + * @return The bytes for a. + */ + com.google.protobuf.ByteString + getABytes(); + + /** + * string b = 2 [json_name = "b"]; + * @return Whether the b field is set. + */ + boolean hasB(); + /** + * string b = 2 [json_name = "b"]; + * @return The b. + */ + java.lang.String getB(); + /** + * string b = 2 [json_name = "b"]; + * @return The bytes for b. + */ + com.google.protobuf.ByteString + getBBytes(); + + build.buf.validate.conformance.cases.RequiredProto3OneOfIgnoreAlways.ValCase getValCase(); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OptionalScalarIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OptionalScalarIgnoreAlways.java new file mode 100644 index 00000000..22054338 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OptionalScalarIgnoreAlways.java @@ -0,0 +1,525 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto3.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways} + */ +public final class RequiredProto3OptionalScalarIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways) + RequiredProto3OptionalScalarIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredProto3OptionalScalarIgnoreAlways.class.getName()); + } + // Use RequiredProto3OptionalScalarIgnoreAlways.newBuilder() to construct. + private RequiredProto3OptionalScalarIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredProto3OptionalScalarIgnoreAlways() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalarIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalarIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways.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", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + @java.lang.Override + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional 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; + } + } + /** + * optional 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 (((bitField0_ & 0x00000001) != 0)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.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.RequiredProto3OptionalScalarIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways) 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.RequiredProto3OptionalScalarIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways 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.RequiredProto3OptionalScalarIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways 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.RequiredProto3OptionalScalarIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways 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.RequiredProto3OptionalScalarIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto3OptionalScalarIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways) + build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalarIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalarIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3OptionalScalarIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways 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 mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways.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", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + public boolean hasVal() { + return ((bitField0_ & 0x00000001) != 0); + } + /** + * optional 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; + } + } + /** + * optional 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; + } + } + /** + * optional 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; + } + /** + * optional 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; + } + /** + * optional 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; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredProto3OptionalScalarIgnoreAlways 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.RequiredProto3OptionalScalarIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OptionalScalarIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OptionalScalarIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..a435c863 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3OptionalScalarIgnoreAlwaysOrBuilder.java @@ -0,0 +1,28 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto3.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredProto3OptionalScalarIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto3OptionalScalarIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * optional string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return Whether the val field is set. + */ + boolean hasVal(); + /** + * optional string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The val. + */ + java.lang.String getVal(); + /** + * optional 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/RequiredProto3RepeatedIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3RepeatedIgnoreAlways.java new file mode 100644 index 00000000..ea82a55d --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3RepeatedIgnoreAlways.java @@ -0,0 +1,554 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto3.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways} + */ +public final class RequiredProto3RepeatedIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways) + RequiredProto3RepeatedIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredProto3RepeatedIgnoreAlways.class.getName()); + } + // Use RequiredProto3RepeatedIgnoreAlways.newBuilder() to construct. + private RequiredProto3RepeatedIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredProto3RepeatedIgnoreAlways() { + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3RepeatedIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3RepeatedIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways.Builder.class); + } + + public static final int VAL_FIELD_NUMBER = 1; + @SuppressWarnings("serial") + private com.google.protobuf.LazyStringArrayList val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public com.google.protobuf.ProtocolStringList + getValList() { + return val_; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated string 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 java.lang.String getVal(int index) { + return val_.get(index); + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the value to return. + * @return The bytes of the val at the given index. + */ + public com.google.protobuf.ByteString + getValBytes(int index) { + return val_.getByteString(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++) { + com.google.protobuf.GeneratedMessage.writeString(output, 1, val_.getRaw(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 += computeStringSizeNoTag(val_.getRaw(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.RequiredProto3RepeatedIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways) 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.RequiredProto3RepeatedIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways 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.RequiredProto3RepeatedIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways 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.RequiredProto3RepeatedIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways 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.RequiredProto3RepeatedIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto3RepeatedIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways) + build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3RepeatedIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3RepeatedIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.BuilderParent parent) { + super(parent); + + } + @java.lang.Override + public Builder clear() { + super.clear(); + bitField0_ = 0; + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + return this; + } + + @java.lang.Override + public com.google.protobuf.Descriptors.Descriptor + getDescriptorForType() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3RepeatedIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + val_.makeImmutable(); + result.val_ = val_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways.getDefaultInstance()) return this; + if (!other.val_.isEmpty()) { + if (val_.isEmpty()) { + val_ = other.val_; + 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 10: { + java.lang.String s = input.readStringRequireUtf8(); + ensureValIsMutable(); + val_.add(s); + 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.LazyStringArrayList val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + private void ensureValIsMutable() { + if (!val_.isModifiable()) { + val_ = new com.google.protobuf.LazyStringArrayList(val_); + } + bitField0_ |= 0x00000001; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + public com.google.protobuf.ProtocolStringList + getValList() { + val_.makeImmutable(); + return val_; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + public int getValCount() { + return val_.size(); + } + /** + * repeated string 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 java.lang.String getVal(int index) { + return val_.get(index); + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the value to return. + * @return The bytes of the val at the given index. + */ + public com.google.protobuf.ByteString + getValBytes(int index) { + return val_.getByteString(index); + } + /** + * repeated string 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, java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureValIsMutable(); + val_.set(index, value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The val to add. + * @return This builder for chaining. + */ + public Builder addVal( + java.lang.String value) { + if (value == null) { throw new NullPointerException(); } + ensureValIsMutable(); + val_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + /** + * repeated string 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 string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return This builder for chaining. + */ + public Builder clearVal() { + val_ = + com.google.protobuf.LazyStringArrayList.emptyList(); + bitField0_ = (bitField0_ & ~0x00000001);; + onChanged(); + return this; + } + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param value The bytes of the val to add. + * @return This builder for chaining. + */ + public Builder addValBytes( + com.google.protobuf.ByteString value) { + if (value == null) { throw new NullPointerException(); } + checkByteStringIsUtf8(value); + ensureValIsMutable(); + val_.add(value); + bitField0_ |= 0x00000001; + onChanged(); + return this; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredProto3RepeatedIgnoreAlways 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.RequiredProto3RepeatedIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3RepeatedIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3RepeatedIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..f7f70404 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3RepeatedIgnoreAlwaysOrBuilder.java @@ -0,0 +1,36 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto3.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredProto3RepeatedIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto3RepeatedIgnoreAlways) + com.google.protobuf.MessageOrBuilder { + + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return A list containing the val. + */ + java.util.List + getValList(); + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @return The count of val. + */ + int getValCount(); + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the element to return. + * @return The val at the given index. + */ + java.lang.String getVal(int index); + /** + * repeated string val = 1 [json_name = "val", (.buf.validate.field) = { ... } + * @param index The index of the value to return. + * @return The bytes of the val at the given index. + */ + com.google.protobuf.ByteString + getValBytes(int index); +} diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3ScalarIgnoreAlways.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3ScalarIgnoreAlways.java new file mode 100644 index 00000000..2c4700f2 --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3ScalarIgnoreAlways.java @@ -0,0 +1,501 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto3.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +/** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways} + */ +public final class RequiredProto3ScalarIgnoreAlways extends + com.google.protobuf.GeneratedMessage implements + // @@protoc_insertion_point(message_implements:buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways) + RequiredProto3ScalarIgnoreAlwaysOrBuilder { +private static final long serialVersionUID = 0L; + static { + com.google.protobuf.RuntimeVersion.validateProtobufGencodeVersion( + com.google.protobuf.RuntimeVersion.RuntimeDomain.PUBLIC, + /* major= */ 4, + /* minor= */ 30, + /* patch= */ 1, + /* suffix= */ "", + RequiredProto3ScalarIgnoreAlways.class.getName()); + } + // Use RequiredProto3ScalarIgnoreAlways.newBuilder() to construct. + private RequiredProto3ScalarIgnoreAlways(com.google.protobuf.GeneratedMessage.Builder builder) { + super(builder); + } + private RequiredProto3ScalarIgnoreAlways() { + val_ = ""; + } + + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3ScalarIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3ScalarIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways.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.GeneratedMessage.isStringEmpty(val_)) { + com.google.protobuf.GeneratedMessage.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.GeneratedMessage.isStringEmpty(val_)) { + size += com.google.protobuf.GeneratedMessage.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.RequiredProto3ScalarIgnoreAlways)) { + return super.equals(obj); + } + build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways other = (build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways) 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.RequiredProto3ScalarIgnoreAlways parseFrom( + java.nio.ByteBuffer data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways 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.RequiredProto3ScalarIgnoreAlways parseFrom( + com.google.protobuf.ByteString data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways 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.RequiredProto3ScalarIgnoreAlways parseFrom(byte[] data) + throws com.google.protobuf.InvalidProtocolBufferException { + return PARSER.parseFrom(data); + } + public static build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways 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.RequiredProto3ScalarIgnoreAlways parseFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways parseFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input, extensionRegistry); + } + + public static build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways parseDelimitedFrom(java.io.InputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input); + } + + public static build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways parseDelimitedFrom( + java.io.InputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseDelimitedWithIOException(PARSER, input, extensionRegistry); + } + public static build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .parseWithIOException(PARSER, input); + } + public static build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways parseFrom( + com.google.protobuf.CodedInputStream input, + com.google.protobuf.ExtensionRegistryLite extensionRegistry) + throws java.io.IOException { + return com.google.protobuf.GeneratedMessage + .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.RequiredProto3ScalarIgnoreAlways 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.GeneratedMessage.BuilderParent parent) { + Builder builder = new Builder(parent); + return builder; + } + /** + * Protobuf type {@code buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways} + */ + public static final class Builder extends + com.google.protobuf.GeneratedMessage.Builder implements + // @@protoc_insertion_point(builder_implements:buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways) + build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlwaysOrBuilder { + public static final com.google.protobuf.Descriptors.Descriptor + getDescriptor() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3ScalarIgnoreAlways_descriptor; + } + + @java.lang.Override + protected com.google.protobuf.GeneratedMessage.FieldAccessorTable + internalGetFieldAccessorTable() { + return build.buf.validate.conformance.cases.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3ScalarIgnoreAlways_fieldAccessorTable + .ensureFieldAccessorsInitialized( + build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways.class, build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways.Builder.class); + } + + // Construct using build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways.newBuilder() + private Builder() { + + } + + private Builder( + com.google.protobuf.GeneratedMessage.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.RequiredFieldProto3Proto.internal_static_buf_validate_conformance_cases_RequiredProto3ScalarIgnoreAlways_descriptor; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways getDefaultInstanceForType() { + return build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways.getDefaultInstance(); + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways build() { + build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways result = buildPartial(); + if (!result.isInitialized()) { + throw newUninitializedMessageException(result); + } + return result; + } + + @java.lang.Override + public build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways buildPartial() { + build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways result = new build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways(this); + if (bitField0_ != 0) { buildPartial0(result); } + onBuilt(); + return result; + } + + private void buildPartial0(build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways result) { + int from_bitField0_ = bitField0_; + if (((from_bitField0_ & 0x00000001) != 0)) { + result.val_ = val_; + } + } + + @java.lang.Override + public Builder mergeFrom(com.google.protobuf.Message other) { + if (other instanceof build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways) { + return mergeFrom((build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways)other); + } else { + super.mergeFrom(other); + return this; + } + } + + public Builder mergeFrom(build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways other) { + if (other == build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways.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; + } + + // @@protoc_insertion_point(builder_scope:buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways) + } + + // @@protoc_insertion_point(class_scope:buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways) + private static final build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways DEFAULT_INSTANCE; + static { + DEFAULT_INSTANCE = new build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways(); + } + + public static build.buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways getDefaultInstance() { + return DEFAULT_INSTANCE; + } + + private static final com.google.protobuf.Parser + PARSER = new com.google.protobuf.AbstractParser() { + @java.lang.Override + public RequiredProto3ScalarIgnoreAlways 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.RequiredProto3ScalarIgnoreAlways getDefaultInstanceForType() { + return DEFAULT_INSTANCE; + } + +} + diff --git a/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3ScalarIgnoreAlwaysOrBuilder.java b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3ScalarIgnoreAlwaysOrBuilder.java new file mode 100644 index 00000000..e4a5b49e --- /dev/null +++ b/conformance/src/main/java/build/buf/validate/conformance/cases/RequiredProto3ScalarIgnoreAlwaysOrBuilder.java @@ -0,0 +1,23 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// NO CHECKED-IN PROTOBUF GENCODE +// source: buf/validate/conformance/cases/required_field_proto3.proto +// Protobuf Java Version: 4.30.1 + +package build.buf.validate.conformance.cases; + +public interface RequiredProto3ScalarIgnoreAlwaysOrBuilder extends + // @@protoc_insertion_point(interface_extends:buf.validate.conformance.cases.RequiredProto3ScalarIgnoreAlways) + 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/gradle.properties b/gradle.properties index 5135ca59..8f662cd7 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ # Version of buf.build/bufbuild/protovalidate to use. -protovalidate.version = v0.10.3 +protovalidate.version = v0.10.4 # Arguments to the protovalidate-conformance CLI protovalidate.conformance.args = --strict_message --strict_error --expected_failures=expected-failures.yaml